Fix awareness of token expiration
This commit is contained in:
parent
74fa513e9a
commit
8432eafdca
1 changed files with 2 additions and 1 deletions
|
@ -19,7 +19,8 @@ class Re2oAPIClient:
|
|||
self.token = self._obtain_token()
|
||||
|
||||
def _need_renew_token(self):
|
||||
return self.token['expiration'] > datetime.datetime.utcnow() + \
|
||||
return self.token['expiration'] > \
|
||||
datetime.datetime.now(datetime.timezone.utc) + \
|
||||
datetime.timedelta(seconds=TIME_FOR_RENEW)
|
||||
|
||||
def _obtain_token(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue