2

I want to run the scheduler along with the server startup in adonis js. I want to schedule task but don't want to execute it with external command like

adonis run:scheduler
or
node ace run:scheduler

Is there any other way to do so?

1 Answers1

2

You can create your own custom command by using ace or register a new script inside package.json for e.g inside your package.json script object add this property,

"serve:with-scheduler": "node ace serve & node ace run:scheduler"

and then use below to run simultaneously,

npm run serve:with-scheduler"
Asad Jivani
  • 535
  • 1
  • 5
  • 15