mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 11:43:10 +03:00
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:
24
src/app/api/admin/concurrency/route.ts
Normal file
24
src/app/api/admin/concurrency/route.ts
Normal 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 });
|
||||
}
|
||||
Reference in New Issue
Block a user