fix(rate-limit): watchdog, env override, and stage tracing to prevent silent wedges (#1828)

Integrated into release/v3.7.7
This commit is contained in:
payne
2026-04-30 21:48:50 +03:00
committed by GitHub
parent cd27c5cf33
commit 6c172df547
4 changed files with 167 additions and 14 deletions

View File

@@ -0,0 +1,24 @@
import { NextResponse } from "next/server";
import { getAllRateLimitStatus } from "@omniroute/open-sse/services/rateLimitManager.ts";
import {
getStats as getSemaphoreStats,
resetAll as resetAllSemaphores,
} from "@omniroute/open-sse/services/accountSemaphore.ts";
export async function GET() {
return NextResponse.json({
timestamp: new Date().toISOString(),
rateLimits: getAllRateLimitStatus(),
semaphores: getSemaphoreStats(),
});
}
export async function POST(request: Request) {
const url = new URL(request.url);
const action = url.searchParams.get("action");
if (action === "reset-semaphores") {
resetAllSemaphores();
return NextResponse.json({ ok: true, action });
}
return NextResponse.json({ error: "unknown action" }, { status: 400 });
}