Skip to content

Commit

Permalink
If backend status query has failed due to unknown error code 0, set a…
Browse files Browse the repository at this point in the history
… delayed retry until success.
  • Loading branch information
NI committed Sep 13, 2019
1 parent 6594680 commit 25b595b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 25b595b

Please sign in to comment.