diff --git a/app/public/server.js b/app/public/server.js index 15a036175..fb4aea854 100644 --- a/app/public/server.js +++ b/app/public/server.js @@ -67,6 +67,8 @@ function newServerForRepo(repoID) { const statusUpdated = this.raiseStatusUpdatedEvent.bind(this); + const pollInterval = 3000; + function pollOnce() { if (!runningServerAddress || !runningServerCertificate || !runningServerPassword || !runningServerControlPassword) { return; @@ -78,6 +80,7 @@ function newServerForRepo(repoID) { port: parseInt(new URL(runningServerAddress).port), method: "GET", path: "/api/v1/control/status", + timeout: pollInterval, headers: { 'Authorization': 'Basic ' + Buffer.from("server-control" + ':' + runningServerControlPassword).toString('base64') } @@ -104,7 +107,7 @@ function newServerForRepo(repoID) { req.end(); } - const statusPollInterval = setInterval(pollOnce, 3000); + const statusPollInterval = setInterval(pollOnce, pollInterval); runningServerProcess.on('close', (code, signal) => { this.appendToLog(`child process exited with code ${code} and signal ${signal}`);