yes.
This commit is contained in:
parent
b151a40c6d
commit
3bd67cf9a5
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
@ -164,6 +164,8 @@ def get_access_token():
|
|||
code = sp_oauth.get_auth_response()
|
||||
token = sp_oauth.get_access_token(code, as_dict=False)
|
||||
else:
|
||||
if is_token_expired()
|
||||
token_info = refresh_access_token(token_info)
|
||||
token = token_info["access_token"]
|
||||
|
||||
def is_token_expired():
|
||||
|
@ -188,10 +190,8 @@ if __name__ == "__main__":
|
|||
print('led-matrix-viewer started')
|
||||
|
||||
while True:
|
||||
if(is_token_expired()):
|
||||
get_access_token()
|
||||
global token
|
||||
token = refresh_access_token(token)
|
||||
# if(is_token_expired()):
|
||||
# get_access_token()
|
||||
drawCanvas()
|
||||
time.sleep(10)
|
||||
|
||||
|
|
Loading…
Reference in a new issue