From 837bb942148113d938389c5d28f4c6ff14ddb3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Mon, 22 Mar 2021 20:22:38 -0700 Subject: [PATCH] interface/gcp: stop polling for gcp store config We polled on -gcp-is-configured before, so that if the store got configured, Landscape would get a token without needing a browser refresh. But the resulting POSTs were bothersome, so now we only check once and stop if GCP store doesn't seem to be configured. We could check 0 times (and delete -gcp-is-configured), but this has problems. Mainly: - there would be no way to tell whether GCP store was unconfigured or misconfigured - if -gcp-get-token failed intermittently (e.g. the token-uri was down for a moment), we would not get a token for that session. We may want to make GCP store into a Gall app of its own, so we can get updates from it for free. Or else perhaps key off of the presence of the store config in settings-store or something. But for now, this fixes urbit/landscape#583. --- pkg/interface/src/logic/lib/gcpManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/logic/lib/gcpManager.ts b/pkg/interface/src/logic/lib/gcpManager.ts index 94bfa9461f..4831ffc5c1 100644 --- a/pkg/interface/src/logic/lib/gcpManager.ts +++ b/pkg/interface/src/logic/lib/gcpManager.ts @@ -76,7 +76,8 @@ class GcpManager { if (this.isConfigured()) { this.refreshLoop(); } else { - this.refreshAfter(10_000); + console.log('GcpManager: GCP storage not configured; stopping.'); + this.stop(); } }) .catch((reason) => {