delete command on timeout
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Kieran 2024-02-29 12:13:08 +00:00
parent ed7929db50
commit a0aa86a0b3
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@snort/worker-relay",
"version": "1.0.2",
"version": "1.0.3",
"description": "A nostr relay in a service worker",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -73,6 +73,7 @@ export class WorkerRelayInterface {
this.#worker.postMessage(msg);
return await new Promise<R>((resolve, reject) => {
const t = setTimeout(() => {
this.#commandQueue.delete(id);
reject(new Error("Timeout"));
}, this.timeout);
this.#commandQueue.set(id, (v, port) => {