]> git.codecow.com Git - libnemo.git/commitdiff
Remove invalid and completed tasks from vault queue.
authorChris Duncan <chris@codecow.com>
Mon, 3 Aug 2026 00:37:53 +0000 (17:37 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 3 Aug 2026 00:37:53 +0000 (17:37 -0700)
src/lib/vault/index.ts

index 99df9f2fcd8a0eb546594ddcf2576b1b97d06eda..cf2a2616391469b091676fa8b83ad9cb791c307f 100644 (file)
@@ -88,6 +88,7 @@ export class Vault {
                                BROWSER: this.#worker.postMessage(data, buffers)
                                NODE: this.#worker.postMessage({ data }, buffers)
                        } catch (err) {
+                               this.#tasks.delete(taskId)
                                reject(err)
                        }
                })
@@ -120,6 +121,7 @@ export class Vault {
                        }
                        if (taskId === 'autolock') return
                        const task = this.#tasks.get(taskId)
+                       this.#tasks.delete(taskId)
                        if (task == null) {
                                throw new Error(`Vault worker returned results without an associated task for ID ${taskId}`)
                        }