-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to manage schedulers programmatically in a web environment #8
Comments
you can access the scheduler instance, and modify/add wtvr u want here import scheduler from 'adonisjs-scheduler/services/main'
scheduler.command("inspire").everyFiveSeconds();
scheduler.items // u can access all added commands here and probably u need a custom logic, check how its done here https://github.com/KABBOUCHI/adonisjs-scheduler/blob/master/commands/scheduler_command.ts |
How can I stop and start (scheduler.items|item) programmatically Similar to the following: Thank you very much, @KABBOUCHI |
i have the same question. Inside the adonisrc.ts i add 'web'. But how start the scheduler when the application boots?
Bye, René |
Here is how I ended up approaching this:
app.ready(async () => {
await import('#start/scheduler');
const ace = await app.container.make('ace');
await ace.exec('scheduler:run', []);
}); |
Nice! Thank you very much! |
Thank you very much! @mattsimonis "Scheduler: Run" is fine, but how do I stop it? |
I want to adjust parameters programmatically and run and stop the scheduler at (environment: ['web'])
The text was updated successfully, but these errors were encountered: