Skip to content

Commit c04496a

Browse files
committed
chore: wip
1 parent 4657bc0 commit c04496a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.stacks/core/types/src/cron-jobs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface CronJobOptions {
66
* The name of the cron job.
77
*/
88
name?: string
9-
function: string
9+
action: string | Function
1010
schedule: string
1111
description?: string
1212
enabled?: boolean

app/jobs/index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import type { CronJob } from '@stacksjs/types'
22

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
65
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',
1114
} satisfies CronJob

0 commit comments

Comments
 (0)