File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export interface CronJobOptions {
6
6
* The name of the cron job.
7
7
*/
8
8
name ?: string
9
- function : string
9
+ action : string | Function
10
10
schedule : string
11
11
description ?: string
12
12
enabled ?: boolean
Original file line number Diff line number Diff line change 1
1
import type { CronJob } from '@stacksjs/types'
2
2
3
- // easily monitor and manage your cron jobs
4
- export default { // or <CronJobs>
5
- function : '/demo' , // ./resources/functions/demo.ts
3
+ export default {
4
+ // required
6
5
schedule : '*/5 * * * *' , // at every 5th minute
7
- name : 'Demo Cron Job' , // optional
8
- description : 'A demo cron job that runs at every 5th minute' , // optional
9
- timezone : 'America/New_York' , // optional, defaults to APP_TIMEZONE
10
- active : true , // optional, defaults to true
6
+ action : ( ) => {
7
+ // eslint-disable-next-line no-console
8
+ console . log ( 'This cron job runs every 5th minute' )
9
+ } ,
10
+
11
+ // optional
12
+ name : 'Demo Job' ,
13
+ description : 'A demo cron job that runs every 5th minute' ,
11
14
} satisfies CronJob
You can’t perform that action at this time.
0 commit comments