File tree Expand file tree Collapse file tree
apps/sim/app/api/cron/cleanup-table-row-ttl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe('table row TTL cleanup route', () => {
1919 beforeEach ( ( ) => {
2020 vi . clearAllMocks ( )
2121 vi . useFakeTimers ( )
22- vi . setSystemTime ( new Date ( '2026-08-22T17:12 :00Z' ) )
22+ vi . setSystemTime ( new Date ( '2026-08-22T17:01 :00Z' ) )
2323 mockVerifyCronAuth . mockReturnValue ( null )
2424 mockEnqueue . mockResolvedValue ( 'job-ttl-1' )
2525 mockGetJobQueue . mockResolvedValue ( { enqueue : mockEnqueue } )
@@ -46,15 +46,15 @@ describe('table row TTL cleanup route', () => {
4646 { } ,
4747 expect . objectContaining ( {
4848 maxAttempts : 1 ,
49- jobId : 'cleanup-table-row-ttl:5958062 ' ,
49+ jobId : 'cleanup-table-row-ttl:1986020 ' ,
5050 concurrencyKey : 'cleanup:table-row-ttl' ,
5151 concurrencyLimit : 1 ,
5252 runner : expect . any ( Function ) ,
5353 } )
5454 )
5555 } )
5656
57- it ( 'deduplicates retries within the same five -minute schedule window' , async ( ) => {
57+ it ( 'deduplicates retries within the same fifteen -minute schedule window' , async ( ) => {
5858 const request = ( ) =>
5959 createMockRequest (
6060 'GET' ,
@@ -64,7 +64,7 @@ describe('table row TTL cleanup route', () => {
6464 )
6565
6666 await GET ( request ( ) )
67- vi . advanceTimersByTime ( 2 * 60 * 1000 )
67+ vi . advanceTimersByTime ( 13 * 60 * 1000 )
6868 await GET ( request ( ) )
6969
7070 expect ( mockEnqueue . mock . calls [ 0 ] ?. [ 2 ] ?. jobId ) . toBe ( mockEnqueue . mock . calls [ 1 ] ?. [ 2 ] ?. jobId )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
77export const dynamic = 'force-dynamic'
88
99const logger = createLogger ( 'CleanupTableRowTtlApi' )
10- const TTL_CLEANUP_INTERVAL_MS = 5 * 60 * 1000
10+ const TTL_CLEANUP_INTERVAL_MS = 15 * 60 * 1000
1111
1212export const GET = withRouteHandler ( async ( request : NextRequest ) => {
1313 try {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ SHELL=/bin/sh
40400 * * * * curl -fsS -m 300 -o /dev/null -H "Authorization: Bearer $CRON_SECRET" "$SIM_URL/api/cron/run-data-drains"
4141
4242# Deletes table rows whose TTL column has expired
43- */5 * * * * curl -fsS -m 60 -o /dev/null -H "Authorization: Bearer $CRON_SECRET" "$SIM_URL/api/cron/cleanup-table-row-ttl"
43+ */15 * * * * curl -fsS -m 60 -o /dev/null -H "Authorization: Bearer $CRON_SECRET" "$SIM_URL/api/cron/cleanup-table-row-ttl"
4444
4545# Microsoft Graph subscription renewal (Teams chat triggers expire after ~3 days)
46460 */12 * * * curl -fsS -m 120 -o /dev/null -H "Authorization: Bearer $CRON_SECRET" "$SIM_URL/api/cron/renew-subscriptions"
Original file line number Diff line number Diff line change @@ -1458,7 +1458,7 @@ cronjobs:
14581458 cleanupTableRowTtl :
14591459 enabled : true
14601460 name : cleanup-table-row-ttl
1461- schedule : " */5 * * * *"
1461+ schedule : " */15 * * * *"
14621462 path : " /api/cron/cleanup-table-row-ttl"
14631463 concurrencyPolicy : Forbid
14641464 successfulJobsHistoryLimit : 3
You can’t perform that action at this time.
0 commit comments