We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7259e3 commit b53ed5dCopy full SHA for b53ed5d
apps/sim/app/api/cron/cleanup-stale-executions/route.ts
@@ -4,10 +4,12 @@ import { createLogger } from '@sim/logger'
4
import { and, eq, lt, sql } from 'drizzle-orm'
5
import { type NextRequest, NextResponse } from 'next/server'
6
import { verifyCronAuth } from '@/lib/auth/internal'
7
+import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
8
9
const logger = createLogger('CleanupStaleExecutions')
10
-const STALE_THRESHOLD_MINUTES = 30
11
+const STALE_THRESHOLD_MS = getMaxExecutionTimeout() + 5 * 60 * 1000
12
+const STALE_THRESHOLD_MINUTES = Math.ceil(STALE_THRESHOLD_MS / 60000)
13
const MAX_INT32 = 2_147_483_647
14
15
export async function GET(request: NextRequest) {
0 commit comments