fixes unawaited call to async enqueue

This commit is contained in:
nai-degen 2024-01-07 16:23:43 -06:00
parent 7f92565739
commit 7b0892ddae
1 changed files with 2 additions and 2 deletions

View File

@ -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",