scheduler-and-jobs
Installation
SKILL.md
Scheduler & Background Jobs (Production)
Reference for making Frappe background jobs and scheduled tasks robust under real-world load. The server-scripts skill covers basic frappe.enqueue and scheduler_events syntax; this is its production-grade companion.
Queue selection
Frappe ships three RQ queues with different timeout defaults:
| Queue | Default timeout | Use for |
|---|---|---|
short |
60 seconds | Quick fire-and-forget: send one email, update one cache key, recompute one denormalized field |
default |
300 seconds (5 min) | Most normal jobs: process one document, sync a small batch |
long |
1500 seconds (25 min) | Bulk imports, monthly reports, heavy data migrations |
frappe.enqueue("my_app.tasks.send_one_email", queue="short", recipient="x@y.com")
frappe.enqueue("my_app.tasks.process_invoice", queue="default", invoice="SINV-001")
frappe.enqueue("my_app.tasks.monthly_aging_report", queue="long")