Importing the scheduler
Import the scheduler service in yourstart/scheduler.ts file:
Scheduling commands
Use thescheduler.command() method to schedule Ace commands. You can schedule commands by their string name or by passing the command class directly.
Scheduling by command name
Scheduling by command class
When scheduling by command class, you can also pass arguments to the command:Scheduling callbacks
Use thescheduler.call() method to schedule custom callback functions:
Chaining frequency methods
Bothscheduler.command() and scheduler.call() return a schedule instance that you can chain with frequency methods to define when the task should run:
Before and after callbacks
You can register callbacks to run before and after your scheduled tasks:before() and after() methods accept asynchronous functions and will be awaited during execution.