mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Mute more long request paths
This commit is contained in:
parent
7328ef2984
commit
03ff4c0c71
@ -105,16 +105,18 @@ export function handleApiRequest(handler: (req: NextRequest, options: any, reque
|
||||
// request duration warning
|
||||
const allowedLongRequestPaths = [
|
||||
"/api/latest/internal/email-queue-step",
|
||||
"/api/v1/internal/analytics/query",
|
||||
"/api/latest/internal/analytics/query",
|
||||
"/health/email",
|
||||
"/api/v1/internal/metrics",
|
||||
"/api/latest/internal/metrics",
|
||||
"/api/latest/internal/external-db-sync/poller",
|
||||
"/api/latest/internal/external-db-sync/sequencer",
|
||||
"/api/latest/internal/external-db-sync/sync-engine",
|
||||
];
|
||||
const warnAfterSeconds = allowedLongRequestPaths.includes(req.nextUrl.pathname) ? 240 : 12;
|
||||
const allAllowedLongRequestPaths = [
|
||||
...allowedLongRequestPaths,
|
||||
...allowedLongRequestPaths.map(path => path.replace(/^\/api\/latest\//, "/api/v1/")),
|
||||
];
|
||||
const warnAfterSeconds = allAllowedLongRequestPaths.includes(req.nextUrl.pathname) ? 240 : 12;
|
||||
runAsynchronously(async () => {
|
||||
await wait(warnAfterSeconds * 1000);
|
||||
if (!hasRequestFinished) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user