From d2b671465c3b63ebdc2d8682d4245fe45a749d2c Mon Sep 17 00:00:00 2001 From: benStre Date: Mon, 27 Nov 2023 02:20:07 +0100 Subject: [PATCH] fix request timeout --- runtime/runtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/runtime.ts b/runtime/runtime.ts index f55d0044..e69f0548 100644 --- a/runtime/runtime.ts +++ b/runtime/runtime.ts @@ -1005,7 +1005,7 @@ export class Runtime { if (timeout > 0 && Number.isFinite(timeout)) { timeoutId = setTimeout(()=>{ // reject if response wasn't already received (might still be processed, and resolve not yet called) - if (!this.callbacks_by_sid.get(unique_sid)?.[2]) reject(new NetworkError("DATEX request timeout after "+timeout+"ms: " + unique_sid + " to " + Runtime.valueToDatexString(to))); + reject(new NetworkError("DATEX request timeout after "+timeout+"ms: " + unique_sid + " to " + Runtime.valueToDatexString(to))); }, timeout); } this.callbacks_by_sid.set(unique_sid, [resolve, reject, timeoutId]);