Documentation for Cron like events scheduler

This commit is contained in:
Shridhar 2018-01-19 15:15:12 +05:30
parent 46d6b46c0f
commit 75e503ef42

View file

@ -260,6 +260,7 @@ Scheduler hooks are methods that are run periodically in background. Structure f
* `monthly_long`
* `hourly`
* `all`
* `cron`
The scheduler events require celery, celerybeat and redis (or a supported and
configured broker) to be running. The events with suffix '\_long' are for long
@ -275,3 +276,25 @@ Example,
"erpnext.setup.doctype.backup_manager.backup_manager.take_backups_daily"
],
}
#### Cron Like Scheduler
Schedule methods to be executed periodically
Example,
scheduler_events = {
"cron": {
"15 18 * * *": [
"frappe.twofactor.delete_all_barcodes_for_users"
],
"*/6 * * * *": [
"frappe.utils.error.collect_error_snapshots"
],
"annual": [
"frappe.utils.error.collect_error_snapshots"
]
}
}
The asterisk (*) operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month.