Skip to content

Commit 3e099e9

Browse files
chivorotkivsergeibbb
authored andcommitted
Avoids continuous refreshing when GKDev cannot renew expired session
(#4324)
1 parent 4e1b411 commit 3e099e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plus/integrations/models/integration.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export abstract class IntegrationBase<
237237
requestSessionSyncForUsecase(syncReqUsecase: SyncReqUsecase): void {
238238
this._syncRequestsPerFailedUsecase.add(syncReqUsecase);
239239
}
240+
240241
private static readonly requestExceptionLimit = 5;
241242
private requestExceptionCount = 0;
242243

@@ -414,6 +415,10 @@ export abstract class IntegrationBase<
414415
source: source,
415416
},
416417
);
418+
419+
if (session?.expiresAt != null && session.expiresAt < new Date()) {
420+
session = null;
421+
}
417422
} catch (ex) {
418423
await this.container.storage.deleteWorkspace(this.connectedKey);
419424

0 commit comments

Comments
 (0)