aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/ClientDiagnostics.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-02 12:12:58 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-02 12:12:58 -0500
commit77ee66de66a411f79bbbc036d379d09be38d172f (patch)
treeddb0936a3adbe6821d44906d46ac9cd0182b4d15 /src/client/util/ClientDiagnostics.ts
parentee1ac7b8c9550cc842e91985c1a92d79ce0e5235 (diff)
further cleanup
Diffstat (limited to 'src/client/util/ClientDiagnostics.ts')
-rw-r--r--src/client/util/ClientDiagnostics.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/client/util/ClientDiagnostics.ts b/src/client/util/ClientDiagnostics.ts
index 7eef935fd..0a213aa1c 100644
--- a/src/client/util/ClientDiagnostics.ts
+++ b/src/client/util/ClientDiagnostics.ts
@@ -12,18 +12,22 @@ export namespace ClientDiagnostics {
serverPolls--;
}, 1000 * 15);
-
let executed = false;
- const handle = async () => {
+ let solrHandle: NodeJS.Timeout | undefined;
+ const handler = async () => {
const response = await fetch("/solrHeartbeat");
if (!(await response.json()).running) {
- !executed && alert("Looks like SOLR is not running on your machine.");
- executed = true;
- clearInterval(solrHandle);
+ if (!executed) {
+ alert("Looks like SOLR is not running on your machine.");
+ executed = true;
+ solrHandle && clearInterval(solrHandle);
+ }
}
};
- await handle();
- const solrHandle = setInterval(handle, 1000 * 15);
+ await handler();
+ if (!executed) {
+ solrHandle = setInterval(handler, 1000 * 15);
+ }
}