delete command on timeout
This commit is contained in:
parent
ed7929db50
commit
a0aa86a0b3
@ -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",
|
||||
|
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user