fixes broken AWS rate limit backoff

This commit is contained in:
nai-degen
2023-10-24 09:19:46 -05:00
parent 89e9b67f3f
commit 26dc79c8f1
9 changed files with 45 additions and 43 deletions
+2
View File
@@ -3,6 +3,7 @@ import { createProxyMiddleware } from "http-proxy-middleware";
import { v4 } from "uuid";
import { config } from "../config";
import { logger } from "../logger";
import { keyPool } from "../shared/key-management";
import { createQueueMiddleware } from "./queue";
import { ipLimiter } from "./rate-limit";
import { handleProxyError } from "./middleware/common";
@@ -134,6 +135,7 @@ const awsProxy = createQueueMiddleware(
on: {
proxyReq: createOnProxyReqHandler({
pipeline: [
(_, req) => keyPool.throttle(req.key!),
applyQuotaLimits,
// Credentials are added by signAwsRequest preprocessor
languageFilter,