This commit is contained in:
parent
ed7929db50
commit
a0aa86a0b3
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/worker-relay",
|
"name": "@snort/worker-relay",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "A nostr relay in a service worker",
|
"description": "A nostr relay in a service worker",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -73,6 +73,7 @@ export class WorkerRelayInterface {
|
|||||||
this.#worker.postMessage(msg);
|
this.#worker.postMessage(msg);
|
||||||
return await new Promise<R>((resolve, reject) => {
|
return await new Promise<R>((resolve, reject) => {
|
||||||
const t = setTimeout(() => {
|
const t = setTimeout(() => {
|
||||||
|
this.#commandQueue.delete(id);
|
||||||
reject(new Error("Timeout"));
|
reject(new Error("Timeout"));
|
||||||
}, this.timeout);
|
}, this.timeout);
|
||||||
this.#commandQueue.set(id, (v, port) => {
|
this.#commandQueue.set(id, (v, port) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user