Skip to content

Commit 3e31b85

Browse files
authored
Merge pull request #85 from RelationalAI/hnr-anticipate-token-expiration
Anticipate access token expiration
2 parents ed0a17b + 0f3b69a commit 3e31b85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

railib/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, access_token: str, expires_in: int):
4646
self.created_on = round(time.time())
4747

4848
def is_expired(self):
49-
return time.time() - self.created_on >= self.expires_in
49+
return time.time() - self.created_on >= self.expires_in - 5 # anticipate token expiration by 5 seconds
5050

5151

5252
# Represents OAuth client credentials.

0 commit comments

Comments
 (0)