fix: catch stop() already called on concurrent 429s

Multiple concurrent requests can receive 429 simultaneously, causing
stop() to be called on an already-stopped limiter. Add .catch() to
prevent unhandled rejection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Oleg Saprykin
2026-03-20 18:27:46 +03:00
parent 64f040bddd
commit b29456c8e5

View File

@@ -352,7 +352,7 @@ export function updateFromHeaders(provider, connectionId, headers, status, model
// After stop, delete from Map so getLimiter() creates a fresh instance.
limiter.stop({ dropWaitingJobs: true }).then(() => {
limiters.delete(limiterKey);
});
}).catch(() => {});
return;
}