0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/bin/start-worker
Tom Owers 3a90d82940
fix(celery): Run celery locally as a single worker (#21772)
Run celery locally as a single worker
2024-04-23 23:15:35 +02:00

17 lines
497 B
Bash
Executable File

#!/bin/bash
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)
SKIP_ASYNC_MIGRATIONS_SETUP=0 CELERY_WORKER_QUEUES=$CELERY_WORKER_QUEUES celery -A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-mingle --pool=solo -Ofair -n node@%h &
if [[ "$PLUGIN_SERVER_IDLE" != "1" && "$PLUGIN_SERVER_IDLE" != "true" ]]; then
./bin/plugin-server
fi
wait