Skip to content

Commit 12632d4

Browse files
committed
chore: wip
1 parent 0b00951 commit 12632d4

File tree

7 files changed

+349
-186
lines changed

7 files changed

+349
-186
lines changed

app/Jobs/ExampleJob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default new Job({
99
backoff: 3, // optional, defaults to 3-second delays between retries
1010
rate: Every.Minute, // optional, '* * * * *' in cron syntax
1111
handle: () => {
12-
// action: 'SendWelcomeEmail', // instead of handle, you may target an action or `action: () => {`
1312
log.info('This message logs every minute') // unless triggered via a route.job() call, in which case it logs once
1413
},
14+
// action: 'SendWelcomeEmail', // instead of handle, you may target an action or `action: () => {`
1515
})

app/Jobs/ExampleTwoJob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Every } from '@stacksjs/types'
55
export default new Job({
66
rate: Every.TwoMinutes, // optional, '*/2 * * * *' in cron syntax
77
handle: () => {
8-
// action: 'SendWelcomeEmail', // instead of handle, you may target an action or `action: () => {`
98
log.info('This cron job log this message every two minutes')
109
log.info('Please note, any job may also be dispatched individually, or scheduled via ./app/Schedule')
1110
},
11+
// action: 'SendWelcomeEmail', // instead of handle, you may target an action or `action: () => {`
1212
})

app/Scheduler.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
// import process from 'node:process'
2-
// import { schedule } from '@stacksjs/scheduler'
1+
import process from 'node:process'
2+
import { schedule } from '@stacksjs/scheduler'
33

4-
// /**
5-
// * **Scheduler**
6-
// *
7-
// * This is your Scheduler. Because Stacks is fully-typed, you may hover any of the
8-
// * options below and the definitions will be provided. In case you have any
9-
// * questions, feel free to reach out via Discord or GitHub Discussions.
10-
// */
11-
// export default function () {
12-
// schedule.job('name').everyFiveMinutes()
13-
// schedule.action('name').everyFiveMinutes()
14-
// }
4+
/**
5+
* **Scheduler**
6+
*
7+
* This is your Scheduler. Because Stacks is fully-typed, you may hover any of the
8+
* options below and the definitions will be provided. In case you have any
9+
* questions, feel free to reach out via Discord or GitHub Discussions.
10+
*/
11+
export default function () {
12+
schedule.job('name').everyFiveMinutes()
13+
schedule.action('name').everyFiveMinutes()
14+
}
1515

16-
// process.on('SIGINT', () => {
17-
// schedule.gracefulShutdown().then(() => process.exit(0))
18-
// })
16+
process.on('SIGINT', () => {
17+
schedule.gracefulShutdown().then(() => process.exit(0))
18+
})

0 commit comments

Comments
 (0)