From 4b179f8a8a19108081acdf537bb9815801462c68 Mon Sep 17 00:00:00 2001 From: npetrill Date: Thu, 12 Dec 2024 08:59:14 -0500 Subject: [PATCH] refactor token --- scripts/firecloud_api/firecloud_api2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/firecloud_api/firecloud_api2.py b/scripts/firecloud_api/firecloud_api2.py index a35dda3e8d..6125a379e7 100644 --- a/scripts/firecloud_api/firecloud_api2.py +++ b/scripts/firecloud_api/firecloud_api2.py @@ -78,6 +78,7 @@ def get_user_token(self, credentials: credentials): if not credentials.valid: logging.info("Fetching user's new access token") credentials.refresh(Request()) + logging.info("Token refreshed.") else: expiry_timestamp = credentials.expiry.replace(tzinfo=timezone.utc).timestamp() now_timestamp = datetime.now(timezone.utc).timestamp() @@ -85,6 +86,7 @@ def get_user_token(self, credentials: credentials): if expiry_timestamp - now_timestamp < 60: logging.info("Fetching user's new access token") credentials.refresh(Request()) + logging.info("Token refreshed.") return credentials.token