|
1 | 1 | /* eslint-disable @typescript-eslint/no-unused-vars */ |
2 | | -import { IntentApplicationContext, ServiceProvider } from '@intentjs/core'; |
| 2 | +import { |
| 3 | + IntentApplicationContext, |
| 4 | + ModuleRef, |
| 5 | + ServiceProvider, |
| 6 | +} from '@intentjs/core'; |
3 | 7 | import { OrderPlacedListener } from '#events/listeners/sample-listener'; |
4 | 8 | import { QueueJobs } from '#jobs/job'; |
5 | 9 | import { UserDbRepository } from '#repositories/userDbRepository'; |
@@ -38,71 +42,15 @@ export class AppServiceProvider extends ServiceProvider { |
38 | 42 | /** |
39 | 43 | * Bootstrap any application service here. |
40 | 44 | */ |
41 | | - boot(app: IntentApplicationContext) { |
42 | | - /** |
43 | | - * Schedule Intent Command to run daily. |
44 | | - */ |
45 | | - |
46 | | - Schedule.exec('ls -la') |
47 | | - .everyTwoSeconds() |
48 | | - .appendOutputToFile('output.txt') |
49 | | - .emailOutputTo('vinayak@tryhanalabs.com') |
50 | | - .run(); |
51 | | - |
52 | | - // Schedule.command('send:email') |
53 | | - // // .days([Schedule.MONDAY, Schedule.THURSDAY]) |
54 | | - // .hourly() |
55 | | - // .timezone('America/Chicago') |
56 | | - // .between('8:00', '17:00') |
57 | | - // .run(); |
58 | | - |
59 | | - /** |
60 | | - * Simple callback, with lifecycle methods `before` and `after`. |
61 | | - */ |
62 | | - // Schedule.call(() => { |
63 | | - // console.log('inside the schedule method'); |
64 | | - // return 'hello'; |
65 | | - // }) |
66 | | - // .purpose('sample scheduler') |
67 | | - // .before(() => console.log('this will run before the cron')) |
68 | | - // .after((output: any) => |
69 | | - // console.log('this will run after the cron', output), |
70 | | - // ) |
71 | | - // .onSuccess((result) => |
72 | | - // console.log('this will run on success the cron', result), |
73 | | - // ) |
74 | | - // .onFailure((error) => |
75 | | - // console.log('this will run on failure the cron', error), |
76 | | - // ) |
77 | | - // // .pingBefore('https://webhook.site/79dcb789-869b-459d-9ba9-638aae449328') |
78 | | - // .thenPing('https://webhook.site/79dcb789-869b-459d-9ba9-638aae449328') |
79 | | - // .weekends() |
80 | | - // .everyTwoSeconds() |
81 | | - // // .pingOnSuccess('https://webhook.site/79dcb789-869b-459d-9ba9-638aae449328') |
82 | | - // .when(() => true) |
83 | | - // .appendOutputToFile('output.txt') |
84 | | - // .run(); |
| 45 | + boot(app: IntentApplicationContext) {} |
85 | 46 |
|
86 | | - /** |
87 | | - * Running a job every day at 5AM. |
88 | | - */ |
89 | | - // Schedule.job({ |
90 | | - // job: 'process_abandoned_cart', |
91 | | - // data: { from: '2024-04-16', to: '2024-04-17' }, |
92 | | - // }) |
93 | | - // .purpose('cron dispatching job every day at 5AM') |
94 | | - // .everyFiveSeconds() |
95 | | - // .weekends() |
96 | | - // .run(); |
| 47 | + /** |
| 48 | + * Shutdown any application service here. |
| 49 | + */ |
| 50 | + shutdown(app: IntentApplicationContext) {} |
97 | 51 |
|
98 | | - // Schedule.command('emails:send') |
99 | | - // .daily() |
100 | | - // .onSuccess((result) => { |
101 | | - // console.log('emails:send on success', result); |
102 | | - // }) |
103 | | - // .onFailure((error: Error) => { |
104 | | - // console.log('emails:send on failure', error); |
105 | | - // }) |
106 | | - // .run(); |
107 | | - } |
| 52 | + /** |
| 53 | + * Register any schedules here. |
| 54 | + */ |
| 55 | + async schedules(ref: ModuleRef): Promise<void> {} |
108 | 56 | } |
0 commit comments