We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7838de2 commit 2f8e89bCopy full SHA for 2f8e89b
packages/google-auth/google/auth/_helpers.py
@@ -23,7 +23,11 @@
23
from six.moves import urllib
24
25
26
-REFRESH_THRESHOLD = datetime.timedelta(seconds=300)
+# Token server doesn't provide a new a token when doing refresh unless the
27
+# token is expiring within 30 seconds, so refresh threshold should not be
28
+# more than 30 seconds. Otherwise auth lib will send tons of refresh requests
29
+# until 30 seconds before the expiration, and cause a spike of CPU usage.
30
+REFRESH_THRESHOLD = datetime.timedelta(seconds=20)
31
32
33
def copy_docstring(source_class):
0 commit comments