From 4242b546b6c4879719ed7851bfece4c9def5e24c Mon Sep 17 00:00:00 2001 From: bosiraphael <71827178+bosiraphael@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:41:42 +0100 Subject: [PATCH] Handle error 429 during partial sync (#4258) handle error 429 --- .../messaging/services/gmail-partial-sync.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts b/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts index 279c44404..fae82f7af 100644 --- a/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts +++ b/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts @@ -105,6 +105,14 @@ export class GmailPartialSyncService { return; } + if (error && error.code === 429) { + this.logger.log( + `gmail partial-sync for workspace ${workspaceId} and account ${connectedAccountId}: Error 429: ${error.message}, partial sync will be retried later.`, + ); + + return; + } + if (error) { throw new Error( `Error getting history for ${connectedAccountId} in workspace ${workspaceId} during partial-sync: