mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
get new access token ~60 seconds before old one times out
This commit is contained in:
parent
3f87a8b879
commit
ff7b0f3e2a
@ -78,7 +78,7 @@ class SpotifyClientCredentials(object):
|
|||||||
|
|
||||||
def _is_token_expired(self, token_info):
|
def _is_token_expired(self, token_info):
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
return token_info['expires_at'] < now
|
return token_info['expires_at'] - now < 60
|
||||||
|
|
||||||
def _add_custom_values_to_token_info(self, token_info):
|
def _add_custom_values_to_token_info(self, token_info):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user