Skip to content

Commit

Permalink
feat: add a keep-alive cron for workers that runs every minute
Browse files Browse the repository at this point in the history
  • Loading branch information
rrojan committed Feb 9, 2025
1 parent 169bcf0 commit 881b915
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/jobs/keep-alive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { schedules } from '@trigger.dev/sdk/v3'

export const keepAlive = schedules.task({
id: 'keep-alive',
maxDuration: 10,
cron: '* * * * *',
run: async () => {
// This task does nothing except warm up our workers and ensure it stays active.
return { message: 'Worker is warm' }
},
})

0 comments on commit 881b915

Please sign in to comment.