Commit 142a92ce authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

auth: request refresh tokens with expiry <3 minutes.

Due to swarming, 5 minutes is hard upper limit,
and by the time token arrives to the bot it may be <5 minutes,
like here
https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8947432403218547136%2F%2B%2Fsteps%2Fpresubmit%2F0%2Fstdout

R=vadimsh@chromium.org

Bug: 837087
Change-Id: I98fbe3f0f85c9f62bc984f439614c3f88a16ed06
Reviewed-on: https://chromium-review.googlesource.com/1044779Reviewed-by: 's avatarVadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent 15759121
......@@ -81,8 +81,8 @@ class AccessToken(collections.namedtuple('AccessToken', [
"""True if this AccessToken should be refreshed."""
if self.expires_at is not None:
now = now or datetime.datetime.utcnow()
# Allow 5 min of clock skew between client and backend.
now += datetime.timedelta(seconds=300)
# Allow 3 min of clock skew between client and backend.
now += datetime.timedelta(seconds=180)
return now >= self.expires_at
# Token without expiration time never expires.
return False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment