From 444568a06e23d72bf997d32992bc30227a66955f Mon Sep 17 00:00:00 2001 From: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com> Date: Tue, 30 Nov 2021 14:06:19 -0300 Subject: [PATCH] Add names to celery nodes (#7054 pt. 2) (#7433) * add names to celery nodes * use python instead * hostname naming --- bin/docker-worker-beat | 3 ++- bin/docker-worker-celery | 1 + bin/start-worker | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/docker-worker-beat b/bin/docker-worker-beat index 6b789b38fe8..ca0e63338a3 100755 --- a/bin/docker-worker-beat +++ b/bin/docker-worker-beat @@ -1,5 +1,6 @@ #!/bin/bash set -e + rm celerybeat.pid || echo "celerybeat.pid not found, proceeding" -celery -A posthog beat -S redbeat.RedBeatScheduler \ No newline at end of file +celery -A posthog beat -S redbeat.RedBeatScheduler -n node@%%h \ No newline at end of file diff --git a/bin/docker-worker-celery b/bin/docker-worker-celery index 8bb32f33a67..ef63611f9b6 100755 --- a/bin/docker-worker-celery +++ b/bin/docker-worker-celery @@ -65,6 +65,7 @@ fi FLAGS=() FLAGS+=("-Ofair") +FLAGS+=("-n node@%%h") [ "$with_gossip" == "false" ] && FLAGS+=("--without-gossip") [ "$with_mingle" == "false" ] && FLAGS+=("--without-mingle") [ "$with_heartbeat" == "false" ] && FLAGS+=("--without-heartbeat") diff --git a/bin/start-worker b/bin/start-worker index 5ae9cd8a73f..a79a96df7f3 100755 --- a/bin/start-worker +++ b/bin/start-worker @@ -5,7 +5,7 @@ set -e trap 'kill $(jobs -p)' EXIT # start celery worker with heartbeat (-B) -celery -A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-gossip --without-mingle -Ofair & +celery -A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-gossip --without-mingle -Ofair -n node@%%h & # start celery plugin worker ./bin/plugin-server