From 3604ccf12576543fc246c38d8a354b7342e5e5cc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 1 Feb 2016 14:41:41 +0530 Subject: [PATCH 1/3] [fix] added longjob worker in supervisor.conf --- bench/templates/supervisor.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bench/templates/supervisor.conf b/bench/templates/supervisor.conf index fffd6b73..3f6343d6 100644 --- a/bench/templates/supervisor.conf +++ b/bench/templates/supervisor.conf @@ -8,12 +8,23 @@ user={{ user }} directory={{ sites_dir }} [program:frappe-worker] -command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker +command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n frappe-jobs@%%h --time-limit 360 --loglevel INFO -Ofair autostart=true autorestart=true stdout_logfile={{ bench_dir }}/logs/worker.log stderr_logfile={{ bench_dir }}/logs/worker.error.log user={{ user }} +stopwaitsecs=370 +directory={{ sites_dir }} + +[program:frappe-longjob-worker] +command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n frappe-longjobs@%%h --time-limit 1500 --loglevel INFO +autostart=true +autorestart=true +stdout_logfile={{ bench_dir }}/logs/worker.log +stderr_logfile={{ bench_dir }}/logs/worker.error.log +user={{ user }} +stopwaitsecs=1510 directory={{ sites_dir }} [program:frappe-workerbeat] From 9e68decb751f99372e5012862f2f19927975caa3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 1 Feb 2016 14:49:31 +0530 Subject: [PATCH 2/3] [fix] longjobs@ naming --- bench/templates/supervisor.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/templates/supervisor.conf b/bench/templates/supervisor.conf index 3f6343d6..e97d4aa9 100644 --- a/bench/templates/supervisor.conf +++ b/bench/templates/supervisor.conf @@ -8,7 +8,7 @@ user={{ user }} directory={{ sites_dir }} [program:frappe-worker] -command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n frappe-jobs@%%h --time-limit 360 --loglevel INFO -Ofair +command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n jobs@%%h --time-limit 360 --loglevel INFO -Ofair autostart=true autorestart=true stdout_logfile={{ bench_dir }}/logs/worker.log @@ -18,7 +18,7 @@ stopwaitsecs=370 directory={{ sites_dir }} [program:frappe-longjob-worker] -command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n frappe-longjobs@%%h --time-limit 1500 --loglevel INFO +command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n longjobs@%%h --time-limit 1500 --loglevel INFO autostart=true autorestart=true stdout_logfile={{ bench_dir }}/logs/worker.log From 1d15d534a1f6f83941f8d21aecf5bef350f2d451 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 3 Feb 2016 13:00:31 +0530 Subject: [PATCH 3/3] [fix] added async and longjob worker --- bench/templates/supervisor.conf | 10 ++++++++++ bench/utils.py | 2 ++ 2 files changed, 12 insertions(+) diff --git a/bench/templates/supervisor.conf b/bench/templates/supervisor.conf index e97d4aa9..4808123d 100644 --- a/bench/templates/supervisor.conf +++ b/bench/templates/supervisor.conf @@ -27,6 +27,16 @@ user={{ user }} stopwaitsecs=1510 directory={{ sites_dir }} +[program:frappe-async-worker] +command={{ bench_dir }}/env/bin/python -m frappe.celery_app worker -n async@%%h --time-limit 1500 --loglevel INFO +autostart=true +autorestart=true +stdout_logfile={{ bench_dir }}/logs/worker.log +stderr_logfile={{ bench_dir }}/logs/worker.error.log +user={{ user }} +stopwaitsecs=1510 +directory={{ sites_dir }} + [program:frappe-workerbeat] command={{ bench_dir }}/env/bin/python -m frappe.celery_app beat -s beat.schedule autostart=true diff --git a/bench/utils.py b/bench/utils.py index 61d47dc9..df51fe57 100644 --- a/bench/utils.py +++ b/bench/utils.py @@ -120,6 +120,8 @@ def setup_procfile(with_celery_broker=False, with_watch=False, bench='.'): procfile_contents = { 'web': "./env/bin/frappe --serve --sites_path sites", 'worker': "sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app worker'", + 'longjob_worker': "sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app -n longjobs@%%h worker'", + 'async_worker': "sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app -n async@%%h worker'", 'workerbeat': "sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app beat -s scheduler.schedule'" } if frappe_version > 4: