0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/bin/docker-worker
Marius Andra 66780ceef7
Make workers optional for now, add a warning if they are offline (#494)
* add warning script to settings and docker-worker in case REDIS_URL is not found

* test celery heartbeat

* save celery heartbeat in redis

* /_stats/ with worker heartbeat

* refactor top content

* show worker stats

* heartbeat delay to 90sec

* update worker error message

* remove line

* add redbeat schdeduler

* add redbeat for local development
2020-04-08 13:52:29 +01:00

20 lines
928 B
Bash
Executable File

#!/bin/bash
set -e
if [ -z "$REDIS_URL" ]
then
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
echo "️⚠️ 🚨🚨🚨 PostHog warning! 🚨🚨🚨"
echo "⚠️"
echo "️⚠️ The environment variable REDIS_URL is not configured!"
echo "⚠️ Redis will be mandatory in the next versions of PostHog (1.1.0+)."
echo "⚠️ Please configure it now to avoid future surprises!"
echo "⚠️"
echo "⚠️ See here for more information!"
echo "⚠️ --> https://docs.posthog.com/#/upgrading-posthog?id=upgrading-from-before-1011"
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
else
celery -A posthog beat -S redbeat.RedBeatScheduler &
celery -A posthog worker
fi