mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
feat: Add custom workers in Procfile (#1201)
* feat: updated procfile * fix: add missing context * fix: add missing context
This commit is contained in:
parent
641181260e
commit
593b80eec9
@ -23,7 +23,8 @@ def setup_procfile(bench_path, yes=False, skip_redis=False):
|
|||||||
use_rq=use_rq(bench_path),
|
use_rq=use_rq(bench_path),
|
||||||
webserver_port=config.get('webserver_port'),
|
webserver_port=config.get('webserver_port'),
|
||||||
CI=os.environ.get('CI'),
|
CI=os.environ.get('CI'),
|
||||||
skip_redis=skip_redis)
|
skip_redis=skip_redis,
|
||||||
|
workers=config.get("workers", {}))
|
||||||
|
|
||||||
with open(procfile_path, 'w') as f:
|
with open(procfile_path, 'w') as f:
|
||||||
f.write(procfile)
|
f.write(procfile)
|
||||||
|
@ -14,6 +14,9 @@ schedule: bench schedule
|
|||||||
worker_short: bench worker --queue short 1>> logs/worker.log 2>> logs/worker.error.log
|
worker_short: bench worker --queue short 1>> logs/worker.log 2>> logs/worker.error.log
|
||||||
worker_long: bench worker --queue long 1>> logs/worker.log 2>> logs/worker.error.log
|
worker_long: bench worker --queue long 1>> logs/worker.log 2>> logs/worker.error.log
|
||||||
worker_default: bench worker --queue default 1>> logs/worker.log 2>> logs/worker.error.log
|
worker_default: bench worker --queue default 1>> logs/worker.log 2>> logs/worker.error.log
|
||||||
|
{% for worker_name, worker_details in workers.items() %}
|
||||||
|
worker_{{ worker_name }}: bench worker --queue {{ worker_name }} 1>> logs/worker.log 2>> logs/worker.error.log
|
||||||
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
workerbeat: sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app beat -s scheduler.schedule'
|
workerbeat: sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app beat -s scheduler.schedule'
|
||||||
worker: sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app worker -n jobs@%h -Ofair --soft-time-limit 360 --time-limit 390'
|
worker: sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app worker -n jobs@%h -Ofair --soft-time-limit 360 --time-limit 390'
|
||||||
|
Loading…
Reference in New Issue
Block a user