Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-sunder-s committed Sep 22, 2022
1 parent 9ad68cf commit 96bba68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions google/auth/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ def apply(self, headers, token=None):
)

try:
print_log = True if self.expiry is None or _helpers.utcnow() >= self.expiry - datetime.timedelta(seconds=600) else False
if print_log:
if self.expiry is None:
_LOGGER.debug("expiry is none")
elif _helpers.utcnow() >= self.expiry - datetime.timedelta(seconds=600):
token_info_response = requests.get(
"https://oauth2.googleapis.com/tokeninfo?access_token={}".format(
self.token
Expand Down

0 comments on commit 96bba68

Please sign in to comment.