Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Sep 27, 2024
1 parent 758d952 commit b3bdb03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/eodash_catalog/sh_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ def get_SH_token(endpoint_config: dict) -> str:
client_id = os.getenv(f"SH_CLIENT_ID_{env_id}", "")
client_secret = os.getenv(f"SH_CLIENT_SECRET_{env_id}", "")
# 10 minutes before end of validity
safety_buffer_validity = _token_cache[client_id]["expires_at"] - (60 * 10)
if client_id in _token_cache and (safety_buffer_validity) > (time.time()):
if client_id in _token_cache and (_token_cache[client_id]["expires_at"] - (60 * 10)) > (
time.time()
):
return _token_cache[client_id]["access_token"]
# Create a session
client = BackendApplicationClient(client_id=client_id)
Expand Down

0 comments on commit b3bdb03

Please sign in to comment.