Skip to content

Commit 9dadef1

Browse files
author
Sameera Salameh
committed
Merge branch 'main' of github.com:RelationalAI/rai-sdk-python
2 parents 3a3edb3 + 3e31b85 commit 9dadef1

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)