From 7b0892ddae5a356429ba4bf71137cdb133db3881 Mon Sep 17 00:00:00 2001 From: nai-degen Date: Sun, 7 Jan 2024 16:23:43 -0600 Subject: [PATCH] fixes unawaited call to async enqueue --- src/proxy/queue.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proxy/queue.ts b/src/proxy/queue.ts index 698aa29..4c86fcf 100644 --- a/src/proxy/queue.ts +++ b/src/proxy/queue.ts @@ -334,7 +334,7 @@ export function createQueueMiddleware({ beforeProxy?: RequestPreprocessor; proxyMiddleware: Handler; }): Handler { - return (req, res, next) => { + return async (req, res, next) => { req.proceed = async () => { if (beforeProxy) { try { @@ -352,7 +352,7 @@ export function createQueueMiddleware({ }; try { - enqueue(req); + await enqueue(req); } catch (err: any) { req.res!.status(429).json({ type: "proxy_error",