From c84b85083cc66d85ac5448fe588c53ba5c9c39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szczur?= Date: Fri, 3 Jan 2025 14:49:26 +0100 Subject: [PATCH] fix: mprocs failing cause source: not found --- bin/mprocs.yaml | 4 ++-- bin/start-celery | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 bin/start-celery diff --git a/bin/mprocs.yaml b/bin/mprocs.yaml index f57efc845d834..aeb843bab051a 100644 --- a/bin/mprocs.yaml +++ b/bin/mprocs.yaml @@ -1,9 +1,9 @@ procs: celery-worker: - shell: 'bin/check_kafka_clickhouse_up && source ./bin/celery-queues.env && python manage.py run_autoreload_celery --type=worker' + shell: 'bin/check_kafka_clickhouse_up && ./bin/start-celery worker' celery-beat: - shell: 'bin/check_kafka_clickhouse_up && source ./bin/celery-queues.env && python manage.py run_autoreload_celery --type=beat' + shell: 'bin/check_kafka_clickhouse_up && ./bin/start-celery beat' plugin-server: shell: 'bin/check_kafka_clickhouse_up && ./bin/plugin-server' diff --git a/bin/start-celery b/bin/start-celery new file mode 100755 index 0000000000000..28879d4c14045 --- /dev/null +++ b/bin/start-celery @@ -0,0 +1,12 @@ +#!/bin/bash +# Starts a celery worker / heartbeat job. Must be run with a type of process: worker | beat + +set -e + +# this kills all processes when the last one terminates +trap 'kill $(jobs -p)' EXIT + +source ./bin/celery-queues.env + +# start celery worker with heartbeat (-B) +python manage.py run_autoreload_celery --type=$1 \ No newline at end of file