From fc76897df356c8ee992364c2bc1f3a9330b63211 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 10 Aug 2023 15:23:03 +0800 Subject: [PATCH] timeout = 5 when syncing omnivore data to readwise --- packages/api/src/routers/svc/integrations.ts | 5 ++--- packages/api/src/services/integrations/readwise.ts | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/api/src/routers/svc/integrations.ts b/packages/api/src/routers/svc/integrations.ts index 2b7515ade..4c2e309c9 100644 --- a/packages/api/src/routers/svc/integrations.ts +++ b/packages/api/src/routers/svc/integrations.ts @@ -145,12 +145,11 @@ export function integrationsServiceRouter() { const synced = await integrationService.export(integration, pages) if (!synced) { - logger.info('failed to sync pages', { + logger.error('failed to sync pages', { pageIds, integrationId: integration.id, }) - res.status(400).send('Failed to sync') - return + return res.status(400).send('Failed to sync') } } // delete task name if completed diff --git a/packages/api/src/services/integrations/readwise.ts b/packages/api/src/services/integrations/readwise.ts index 0ee052d5e..8df3e8995 100644 --- a/packages/api/src/services/integrations/readwise.ts +++ b/packages/api/src/services/integrations/readwise.ts @@ -125,6 +125,7 @@ export class ReadwiseIntegration extends IntegrationService { Authorization: `Token ${token}`, ContentType: 'application/json', }, + timeout: 10000, // 10 seconds } ) return response.status === 200