Skip to content

Commit 01fcb19

Browse files
author
Anatoli Kurtsevich
authored
Updated token renewal strategy to ask for a new token if the existing one expires in next 60 sec (#43)
1 parent dbf088a commit 01fcb19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rai-sdk/src/main/java/com/relationalai/AccessToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ long nowEpochSecs() {
4343
}
4444

4545
// Answers if the token is expired.
46-
// Anticipate access token expiration by 5 seconds
46+
// Anticipate access token expiration by 60 seconds
4747
public boolean isExpired() {
48-
return nowEpochSecs() > expiresOn() - 5;
48+
return nowEpochSecs() > expiresOn() - 60;
4949
}
5050
}

0 commit comments

Comments
 (0)