Skip to content

The open alternative to Salesforce, designed for AI.

Handle error 429 during partial sync (#4258)

bosiraphael4242b546b6c4
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 279c44404b2..fae82f7afbd 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: