I need to launch a long running process through an API call.
I have this:
from frappe.utils.background_jobs import enqueue
: : : :
@frappe.whitelist()
def test_enqueue():
ulog("Enqueuing Long Task")
enqueue('myapp.myapp.doctype.myapp.myapp.longTask', now = True, timeout=120000)
return { "result": "Enqueued Long Task" }
I expected to get the immediate response, {"message":{"result":"Enqueued Long Task"}}
.
Instead, I get that response message only when the “enqueued” process completes (after about 10 minutes).
Have I misunderstood something?
Notes:
- Version: ERPNext V13.beta.6
- in ${benchDir}/config/supervisor.conf
: : : :
[program:frappe-bench-DENH-frappe-web]
command=/home/erpdev/frappe-bench-DENH/env/bin/gunicorn -b 127.0.0.1:8000 -w 4 -t 120 frappe.app:application --preload
priority=4
: : : :