0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
posthog/bin/temporal-django-worker

23 lines
329 B
Bash
Executable File

#!/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