From f96a0b7da9e38e00f14923b539ab62ca3fbf6026 Mon Sep 17 00:00:00 2001 From: jianglai Date: Fri, 23 Feb 2018 15:14:09 -0800 Subject: [PATCH] Reduce OAuth token cache time to 30min It seems that even though the token is supposed to be valid for 60min, in practice it expires before that. Reducing caching time to 30min solves the problem (at least as far as I can tell). This should not increase too much load as we are only calling the API twice an hour instead of once. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=186830395 --- java/google/registry/proxy/config/default-config.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/google/registry/proxy/config/default-config.yaml b/java/google/registry/proxy/config/default-config.yaml index 419c4b4cd..c5e468747 100644 --- a/java/google/registry/proxy/config/default-config.yaml +++ b/java/google/registry/proxy/config/default-config.yaml @@ -20,11 +20,15 @@ gcpScopes: # to authenticate. - https://www.googleapis.com/auth/userinfo.email -# Access token is valid for 60 minutes. +# Access token is valid for 30 minutes. # +# Document says that the token should be good for 60 minutes, but in practice +# we've run into problems with token becoming invalid before supposed expiration +# time. 30 minutes seems to be a good compromise which guarantees token validity +# without making many more API calls to the OAuth server. # See also: Data store # (https://developers.google.com/api-client-library/java/google-api-java-client/oauth2#data_store). -accessTokenValidPeriodSeconds: 3600 +accessTokenValidPeriodSeconds: 1800 # Access token is refreshed 1 minutes before expiry. #