Skip to content

Commit

Permalink
update expiratrion calculation in refrewsh_token function
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Jan 8, 2025
1 parent 9cf59cb commit 0796eff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nmdc_automation/api/nmdcapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, site_configuration: Union[str, Path, SiteConfig]):
def refresh_token(func):
def _get_token(self, *args, **kwargs):
# If it expires in 60 seconds, refresh
if not self.token or self.expires_at + 60 > time():
if not self.token or self.expires_at < time() - 60:
self.get_token()
return func(self, *args, **kwargs)

Expand Down

0 comments on commit 0796eff

Please sign in to comment.