From 25b595b5b608cc617f1241e72fae697779b78ccf Mon Sep 17 00:00:00 2001 From: NI Date: Fri, 13 Sep 2019 17:03:05 +0800 Subject: [PATCH] If backend status query has failed due to unknown error code 0, set a delayed retry until success. --- ui/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/app.js b/ui/app.js index e61c3db..d13d676 100644 --- a/ui/app.js +++ b/ui/app.js @@ -38,6 +38,8 @@ import * as sshctl from "./control/ssh.js"; import * as xhr from "./xhr.js"; import * as cipher from "./crypto.js"; +const backendQueryRetryDelay = 2000; + const maxTimeDiff = 30000; const mainTemplate = ` @@ -204,6 +206,12 @@ function startApp(rootEl) { this.page = "auth"; break; + case 0: + setTimeout(() => { + this.tryInitialAuth(); + }, backendQueryRetryDelay); + break; + default: alert("Unexpected backend query status: " + result.result); }