From 7826af0d3a03129cd725161904952808ae114362 Mon Sep 17 00:00:00 2001 From: Anatoli Kurtsevich Date: Mon, 21 Aug 2023 10:08:54 -0400 Subject: [PATCH] Updated token renewal strategy to ask for a new token if the existing one expires in next 60 sec --- rai-sdk/src/main/java/com/relationalai/AccessToken.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rai-sdk/src/main/java/com/relationalai/AccessToken.java b/rai-sdk/src/main/java/com/relationalai/AccessToken.java index deaa3065..cf020049 100644 --- a/rai-sdk/src/main/java/com/relationalai/AccessToken.java +++ b/rai-sdk/src/main/java/com/relationalai/AccessToken.java @@ -43,8 +43,8 @@ long nowEpochSecs() { } // Answers if the token is expired. - // Anticipate access token expiration by 5 seconds + // Anticipate access token expiration by 60 seconds public boolean isExpired() { - return nowEpochSecs() > expiresOn() - 5; + return nowEpochSecs() > expiresOn() - 60; } }