Skip to content

Commit

Permalink
new fresh branch old codebase was stale
Browse files Browse the repository at this point in the history
  • Loading branch information
happycodemonkey committed Sep 5, 2023
1 parent 7920857 commit fb78bbf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/portal/apps/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.conf import settings
from tapipy.tapis import Tapis
from django.db import transaction
from threading import Lock

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -81,7 +82,11 @@ def client(self):
with transaction.atomic():
if self.expired:
try:
client.refresh_tokens()
lock = Lock()
logger.debug("getting lock")
with lock:
logger.debug("refreshing token with lock")
client.refresh_tokens()
except Exception:
logger.exception('Tapis Token refresh failed')
raise
Expand Down

0 comments on commit fb78bbf

Please sign in to comment.