0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-21 21:49:51 +01:00
posthog/bin/temporal-django-worker

23 lines
329 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e
cleanup() {
echo "Stopping worker..."
if kill -0 "$worker_pid" >/dev/null 2>&1; then
kill "$worker_pid"
else
echo "Worker process is not running."
fi
}
trap cleanup SIGINT SIGTERM EXIT
python3 manage.py start_temporal_worker "$@" &
worker_pid=$!
wait $worker_pid
cleanup