diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 21:08:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 21:08:11 +0300 |
commit | 8a7efa45c38ed3200d173d2c3207a8154e583c16 (patch) | |
tree | 1bb4d579b95c79aae4946a06fefa089e5549b722 /lib/support | |
parent | 53b1f4eaa2a451aaba908a5fee7ce97a930021ac (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/support')
-rwxr-xr-x | lib/support/init.d/gitlab | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index 982c1dc8866..5e8e2ab9c25 100755 --- a/lib/support/init.d/gitlab +++ b/lib/support/init.d/gitlab @@ -27,6 +27,7 @@ ### Environment variables RAILS_ENV="production" USE_UNICORN="" +SIDEKIQ_WORKERS=1 # Script variable names should be lower-case not to conflict with # internal /bin/sh variables such as PATH, EDITOR or SHELL. @@ -36,7 +37,6 @@ pid_path="$app_root/tmp/pids" socket_path="$app_root/tmp/sockets" rails_socket="$socket_path/gitlab.socket" web_server_pid_path="$pid_path/unicorn.pid" -sidekiq_pid_path="$pid_path/sidekiq.pid" mail_room_enabled=false mail_room_pid_path="$pid_path/mail_room.pid" gitlab_workhorse_dir=$(cd $app_root/../gitlab-workhorse 2> /dev/null && pwd) @@ -74,6 +74,11 @@ else use_web_server="unicorn" fi +if [ -z "$SIDEKIQ_WORKERS" ]; then + sidekiq_pid_path="$pid_path/sidekiq.pid" +else + sidekiq_pid_path="$pid_path/sidekiq-cluster.pid" +fi ### Init Script functions @@ -295,7 +300,7 @@ start_gitlab() { if [ "$sidekiq_status" = "0" ]; then echo "The Sidekiq job dispatcher is already running with pid $spid, not restarting" else - RAILS_ENV=$RAILS_ENV bin/background_jobs start & + RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs start & fi if [ "$gitlab_workhorse_status" = "0" ]; then @@ -354,7 +359,7 @@ stop_gitlab() { fi if [ "$sidekiq_status" = "0" ]; then echo "Shutting down GitLab Sidekiq" - RAILS_ENV=$RAILS_ENV bin/background_jobs stop + RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs stop fi if [ "$gitlab_workhorse_status" = "0" ]; then echo "Shutting down GitLab Workhorse" @@ -458,7 +463,7 @@ reload_gitlab(){ echo "Done." echo "Restarting GitLab Sidekiq since it isn't capable of reloading its config..." - RAILS_ENV=$RAILS_ENV bin/background_jobs restart + RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs restart if [ "$mail_room_enabled" != true ]; then echo "Restarting GitLab MailRoom since it isn't capable of reloading its config..." |