How to register the command "adonis run: scheduler" from the adonis-scheduler library of @nrempel in the crontab of an Ubuntu operating system?
Package version:
AdonisJs 4.1
Node.js and npm version:
Node js 10.0.1
Npm 3.0
There is no need to register the cronjob in the crontab of the server as in Laravel, just add this code to the Kernel.js of the application, and the programmed cronjobs will be executed automatically.
/*
|--------------------------------------------------------------------------
| Run Scheduler
|--------------------------------------------------------------------------
|
| Run the scheduler on boot of the web sever.
|
*/
const Scheduler = use('Adonis/Addons/Scheduler')
Scheduler.run()
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
There is no need to register the cronjob in the crontab of the server as in Laravel, just add this code to the Kernel.js of the application, and the programmed cronjobs will be executed automatically.
/*
|--------------------------------------------------------------------------
| Run Scheduler
|--------------------------------------------------------------------------
|
| Run the scheduler on boot of the web sever.
|
*/
const Scheduler = use('Adonis/Addons/Scheduler')
Scheduler.run()