summaryrefslogtreecommitdiff
path: root/bin/background_jobs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/background_jobs')
-rwxr-xr-xbin/background_jobs7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/background_jobs b/bin/background_jobs
index f9b42b97e06..d8929881f12 100755
--- a/bin/background_jobs
+++ b/bin/background_jobs
@@ -8,6 +8,8 @@ sidekiq_pidfile="$app_root/tmp/pids/sidekiq-cluster.pid"
sidekiq_logfile="$app_root/log/sidekiq.log"
gitlab_user=$(ls -l config.ru | awk '{print $3}')
+trap cleanup EXIT
+
warn()
{
echo "$@" 1>&2
@@ -59,6 +61,11 @@ start_sidekiq()
${cmd} bin/sidekiq-cluster "${processes_args[@]}" -P $sidekiq_pidfile -e $RAILS_ENV "$@" 2>&1 | tee -a $sidekiq_logfile
}
+cleanup()
+{
+ stop
+}
+
action="$1"
shift