Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added option to provide custom queues #1195

Merged
merged 4 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bench/config/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def generate_supervisor_config(bench_path, user=None, yes=False, skip_redis=Fals
"background_workers": config.get('background_workers') or 1,
"bench_cmd": which('bench'),
"skip_redis": skip_redis,
"workers": config.get("workers", {}),
})

conf_path = os.path.join(bench_path, 'config', 'supervisor.conf')
Expand Down
16 changes: 16 additions & 0 deletions bench/config/templates/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ killasgroup=true
numprocs={{ background_workers }}
process_name=%(program_name)s-%(process_num)d

{% for worker_name, worker_details in workers.items() %}
[program:{{ bench_name }}-frappe-{{ worker_name }}-worker]
command={{ bench_cmd }} worker --queue {{ worker_name }}
priority=4
autostart=true
autorestart=true
stdout_logfile={{ bench_dir }}/logs/worker.log
stderr_logfile={{ bench_dir }}/logs/worker.error.log
user={{ user }}
stopwaitsecs={{ worker_details["timeout"] }}
directory={{ bench_dir }}
killasgroup=true
numprocs={{ worker_details["background_workers"] or background_workers }}
process_name=%(program_name)s-%(process_num)d
{% endfor %}

{% else %}
[program:{{ bench_name }}-frappe-workerbeat]
command={{ bench_dir }}/env/bin/python -m frappe.celery_app beat -s beat.schedule
Expand Down