aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/ClientDiagnostics.ts18
-rw-r--r--src/client/util/Import & Export/DirectoryImportBox.tsx3
2 files changed, 13 insertions, 8 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);
+ }
}
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx
index b5e806a97..104d9e099 100644
--- a/src/client/util/Import & Export/DirectoryImportBox.tsx
+++ b/src/client/util/Import & Export/DirectoryImportBox.tsx
@@ -106,7 +106,8 @@ export default class DirectoryImportBox extends React.Component<FieldViewProps>
runInAction(() => this.phase = `Internal: uploading ${this.quota - this.completed} files to Dash...`);
- const uploads = await BatchedArray.from(validated, { batchSize: 15 }).batchedMapAsync<any>(async (batch, collector) => {
+ const batched = BatchedArray.from(validated, { batchSize: 15 });
+ const uploads = await batched.batchedMapAsync<any>(async (batch, collector) => {
const formData = new FormData();
batch.forEach(file => {