debian-mirror-gitlab/config/initializers/cluster_events_before_phased_restart.rb

15 lines
446 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2019-12-21 20:55:43 +05:30
# Technical debt, this should be ideally upstreamed.
#
# However, there's currently no way to hook before doing
# graceful shutdown today.
#
# Follow-up the issue: https://gitlab.com/gitlab-org/gitlab/issues/34107
2020-03-13 15:44:24 +05:30
if Gitlab::Runtime.puma?
2019-12-21 20:55:43 +05:30
Puma::Cluster.prepend(::Gitlab::Cluster::Mixins::PumaCluster)
2020-03-13 15:44:24 +05:30
elsif Gitlab::Runtime.unicorn?
2019-12-21 20:55:43 +05:30
Unicorn::HttpServer.prepend(::Gitlab::Cluster::Mixins::UnicornHttpServer)
end