Commit 0c75f212 authored by Sean McGivern's avatar Sean McGivern

Allow specifying queues for bin/background_jobs

If you set the SIDEKIQ_QUEUES environment variable, bin/background_jobs
will use that queue list rather than the default ('*'; all queues).
parent c9ec6e4e
......@@ -3,6 +3,7 @@
cd $(dirname $0)/..
app_root=$(pwd)
sidekiq_workers=${SIDEKIQ_WORKERS:-1}
sidekiq_queues=${SIDEKIQ_QUEUES:-*} # Queues to listen to; default to `*` (all)
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}')
......@@ -50,10 +51,10 @@ start_sidekiq()
cmd="${cmd} ${chpst} -P"
fi
# sidekiq-cluster expects '*' '*' arguments (one wildcard for each process).
# sidekiq-cluster expects an argument per process.
for (( i=1; i<=$sidekiq_workers; i++ ))
do
processes_args+=("*")
processes_args+=("${sidekiq_queues}")
done
${cmd} bin/sidekiq-cluster "${processes_args[@]}" -P $sidekiq_pidfile -e $RAILS_ENV "$@"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment