Skip to content

Commit 2888b38

Browse files
author
Anatoli Kurtsevich
authored
Updated token renewal strategy to ask for a new token if the existing one expires in 60 sec (#134)
1 parent 5b65f68 commit 2888b38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

railib/credentials.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def __init__(self, access_token: str, scope: str, expires_in: int, created_on: f
4040

4141
def is_expired(self):
4242
return (
43-
time.time() - self.created_on >= self.expires_in - 5
44-
) # anticipate token expiration by 5 seconds
43+
time.time() - self.created_on >= self.expires_in - 60
44+
) # anticipate token expiration by 60 seconds
4545

4646

4747
# Represents OAuth client credentials.

0 commit comments

Comments
 (0)