From 2227b4ff918558bfdf929adc2ee58560e8808b78 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Fri, 20 Jun 2025 19:33:23 +0100 Subject: [PATCH] chore: Lower the threshold for eager token expiration (#20964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Omar López --- packages/app-store/googlecalendar/lib/CalendarAuth.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/app-store/googlecalendar/lib/CalendarAuth.ts b/packages/app-store/googlecalendar/lib/CalendarAuth.ts index dc03ccd543..09406ebf6b 100644 --- a/packages/app-store/googlecalendar/lib/CalendarAuth.ts +++ b/packages/app-store/googlecalendar/lib/CalendarAuth.ts @@ -29,7 +29,14 @@ const log = logger.getSubLogger({ prefix: ["app-store/googlecalendar/lib/Calenda class MyGoogleOAuth2Client extends OAuth2Client { constructor(client_id: string, client_secret: string, redirect_uri: string) { - super(client_id, client_secret, redirect_uri); + super({ + clientId: client_id, + clientSecret: client_secret, + redirectUri: redirect_uri, + // default: 5 * 60 * 1000, 5 minutes + // tho, fn will never run in excess of 60 seconds + eagerRefreshThresholdMillis: 60000, + }); } isTokenExpiring() {