Skip to content

Commit 7ee9892

Browse files
committed
added check so that expiration is checked before entering token lock
1 parent 339c462 commit 7ee9892

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/dining/api_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def __init__(self):
5858
)
5959

6060
def update_token(self):
61+
if self.expiration > timezone.localtime():
62+
return
6163
with self.token_lock:
62-
if self.expiration > timezone.localtime():
63-
return
6464
body = {
6565
"client_id": settings.DINING_ID,
6666
"client_secret": settings.DINING_SECRET,

0 commit comments

Comments
 (0)