Skip to content

Commit

Permalink
Updated token renewal strategy to ask for a new token if the existing…
Browse files Browse the repository at this point in the history
… one expires in next 60 sec (#43)
  • Loading branch information
antikus authored Aug 22, 2023
1 parent dbf088a commit 01fcb19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rai-sdk/src/main/java/com/relationalai/AccessToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 01fcb19

Please sign in to comment.