Skip to content

Commit ba9ee88

Browse files
committed
Fix compensation for latency
1 parent 3dd4201 commit ba9ee88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/plugins/http-proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function proxyPlugin(fastify) {
2828
// Check if the access token is expired or about to expire
2929
const expiresAt = request.encryptedSession.get(keyTokenExpiresAt);
3030
const now = Date.now();
31-
const REFRESH_BUFFER_SECONDS = 20; // to allow for network latency
31+
const REFRESH_BUFFER_SECONDS = 20 * 1000; // to allow for network latency
3232
if (!expiresAt || now < expiresAt - REFRESH_BUFFER_SECONDS) {
3333
request.log.info("Access token is still valid; no refresh needed.");
3434
return;

0 commit comments

Comments
 (0)