0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/bin/docker-worker
Harry Waye 40616f0d7c
chore(dev): clean up background jobs on EXIT and prop. exit code (#10916)
We were for instance calling trap at a point where it wouldn't get
called, and giving special status to some processes to run in the
foreground.

Instead we:

 1. wait for any process exit
 2. use it's exit code for the calling process
 3. kill background processes on EXIT
2022-07-21 13:32:38 +00:00

15 lines
249 B
Bash
Executable File

#!/bin/bash
set -e
./bin/migrate-check
# Stop any background jobs on exit
trap 'kill $(jobs -p)' EXIT
./bin/plugin-server &
./bin/docker-worker-celery --with-scheduler &
# Exit if any processes exit, and exit with it's exit code
wait -n
exit $?