From 8e81f82d8beb022d4673e0dba0be245fbb3da057 Mon Sep 17 00:00:00 2001 From: pinks Date: Fri, 15 Sep 2023 00:40:12 +0200 Subject: [PATCH] add todo --- bot/mod.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/mod.ts b/bot/mod.ts index ca816ad..ad7dee6 100644 --- a/bot/mod.ts +++ b/bot/mod.ts @@ -32,13 +32,15 @@ bot.api.config.use(async (prev, method, payload, signal) => { let timedOut = false; const timeout = setTimeout(() => { timedOut = true; + // TODO: this sometimes throws with "can't abort a locked stream" and crashes whole process controller.abort(); }, 30 * 1000); signal?.addEventListener("abort", () => { controller.abort(); }); try { - return await prev(method, payload, controller.signal); + const result = await prev(method, payload, controller.signal); + return result; } finally { clearTimeout(timeout); if (timedOut) {