mirror of
https://github.com/stronk-dev/OrchestratorTracker.git
synced 2025-07-05 10:55:09 +02:00
Maybe now then?
This commit is contained in:
parent
2547a026e7
commit
381d4a746f
@ -103,9 +103,15 @@ async function withStorageLock(fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function writeToStorage(key, data) {
|
async function writeToStorage(key, data) {
|
||||||
|
try {
|
||||||
|
const serialized = JSON.stringify(data);
|
||||||
|
if (!serialized) throw new Error("Serialization failed");
|
||||||
await withStorageLock(async () => {
|
await withStorageLock(async () => {
|
||||||
await storage.setItem(key, data);
|
await storage.setItem(key, JSON.parse(serialized));
|
||||||
});
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error writing to storage:", err.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process the task queue continuously
|
// Process the task queue continuously
|
||||||
|
Loading…
x
Reference in New Issue
Block a user