Skip to content

Commit

Permalink
Update flytekit/clients/auth/auth_client.py
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas J. Fan <[email protected]>
  • Loading branch information
rdeaton-freenome and thomasjpfan authored Aug 8, 2024
1 parent 70e52e4 commit aaa5828
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flytekit/clients/auth/auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ def get_creds_from_remote(self) -> Credentials:
"""
# In the absence of globally-set token values, initiate the token request flow
with self._lock:
# Clear cache if it's been more than 60 seconds since the last check
cache_ttl_s = 60

Check warning on line 356 in flytekit/clients/auth/auth_client.py

View check run for this annotation

Codecov / codecov/patch

flytekit/clients/auth/auth_client.py#L356

Added line #L356 was not covered by tests
if self._cached_credentials_ts is not None and self._cached_credentials_ts + cache_ttl_s < time.monotonic():
self._cached_credentials = None

Check warning on line 358 in flytekit/clients/auth/auth_client.py

View check run for this annotation

Codecov / codecov/patch

flytekit/clients/auth/auth_client.py#L358

Added line #L358 was not covered by tests

if self._cached_credentials is not None:
return self._cached_credentials
q = Queue()

Check warning on line 362 in flytekit/clients/auth/auth_client.py

View check run for this annotation

Codecov / codecov/patch

flytekit/clients/auth/auth_client.py#L361-L362

Added lines #L361 - L362 were not covered by tests
Expand Down

0 comments on commit aaa5828

Please sign in to comment.