This plugin adds support for running cronjob in Elysia server.
Install with:
Then use it:
The above code will log heartbeat
every 10 seconds.
Create a cronjob for Elysia server.
type:
CronConfig
accept the parameters specified below:
Job name to register to store
.
This will register the cron instance to store
with a specified name, which can be used to reference in later processes eg. stop the job.
Time to run the job as specified by cron syntax specified as below:
This can be generated by tools like Crontab Guru
This plugin extends cron method to Elysia using cronner.
Below are the config accepted by cronner.
Time zone in Europe/Stockholm format
Schedule start time for the job
Schedule stop time for the job
Maximum number of executions
Continue execution even if an unhandled error is thrown by a triggered function.
The minimum interval between executions, in seconds.
Below you can find the common patterns to use the plugin.
You can stop cronjob manually by accessing cronjob name registered to store
.