Core: Adonisjs Cron Jobs

Created on 23 Aug 2018  路  2Comments  路  Source: adonisjs/core

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

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()

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dezashibi picture dezashibi  路  4Comments

codingphasedotcom picture codingphasedotcom  路  3Comments

seanc picture seanc  路  4Comments

aligoren picture aligoren  路  4Comments

umaams picture umaams  路  3Comments