frappe-background-jobs
Installation
SKILL.md
Frappe Background Jobs
Offload anything slow or external to a worker so the request returns fast. Frappe uses RQ on Redis.
Enqueue
frappe.enqueue(
method="myapp.services.sync.run", # dotted path or callable
queue="long", # short (≤300s) / default (≤300s) / long (≤1500s)
timeout=1800, # override queue default
job_id=f"sync_{doc.name}", # dedup: same id won't double-queue
deduplicate=True,
enqueue_after_commit=True, # wait for the DB txn to commit first
is_async=True, # False = run inline (tests)
# any kwargs below are passed to the method:
doc_name=doc.name,
)