mirror of
https://github.com/stronk-dev/OrchestratorTracker.git
synced 2025-07-05 10:55:09 +02:00
Make sure that node-persist write do not crash the program
This commit is contained in:
parent
8c804e7de7
commit
2547a026e7
@ -120,14 +120,24 @@ async function processQueue() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (staleENSCache) {
|
if (staleENSCache) {
|
||||||
|
try {
|
||||||
console.log("Writing ENS cache to disk");
|
console.log("Writing ENS cache to disk");
|
||||||
await writeToStorage("ensDomainCache", ensDomainCache);
|
await writeToStorage("ensDomainCache", ensDomainCache);
|
||||||
staleENSCache = false;
|
staleENSCache = false;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
console.log("Error writing to storage...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (staleOrchCache) {
|
if (staleOrchCache) {
|
||||||
|
try {
|
||||||
console.log("Writing Orchestrator cache to disk");
|
console.log("Writing Orchestrator cache to disk");
|
||||||
await writeToStorage("orchCache", orchCache);
|
await writeToStorage("orchCache", orchCache);
|
||||||
staleOrchCache = false;
|
staleOrchCache = false;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
console.log("Error writing to storage...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user