summaryrefslogtreecommitdiff
path: root/lib/gitlab/cluster/lifecycle_events.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/cluster/lifecycle_events.rb')
-rw-r--r--lib/gitlab/cluster/lifecycle_events.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/cluster/lifecycle_events.rb b/lib/gitlab/cluster/lifecycle_events.rb
index b05dca409d1..e0f9eb59924 100644
--- a/lib/gitlab/cluster/lifecycle_events.rb
+++ b/lib/gitlab/cluster/lifecycle_events.rb
@@ -44,6 +44,14 @@ module Gitlab
(@master_restart_hooks ||= []) << block
end
+ def on_master_start(&block)
+ if in_clustered_environment?
+ on_before_fork(&block)
+ else
+ on_worker_start(&block)
+ end
+ end
+
#
# Lifecycle integration methods (called from unicorn.rb, puma.rb, etc.)
#