diff options
Diffstat (limited to 'lib/gitlab/event_store.rb')
-rw-r--r-- | lib/gitlab/event_store.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/gitlab/event_store.rb b/lib/gitlab/event_store.rb index 3d7b6b27eb0..e20ea1c7365 100644 --- a/lib/gitlab/event_store.rb +++ b/lib/gitlab/event_store.rb @@ -18,7 +18,7 @@ module Gitlab end def self.instance - @instance ||= configure! + @instance ||= Store.new { |store| configure!(store) } end # Define all event subscriptions using: @@ -29,14 +29,15 @@ module Gitlab # # store.subscribe(DomainA::SomeWorker, to: DomainB::SomeEvent), if: ->(event) { event.data == :some_value } # - def self.configure! - Store.new do |store| - ### - # Add subscriptions here: + def self.configure!(store) + ### + # Add subscriptions here: - store.subscribe ::MergeRequests::UpdateHeadPipelineWorker, to: ::Ci::PipelineCreatedEvent - end + store.subscribe ::MergeRequests::UpdateHeadPipelineWorker, to: ::Ci::PipelineCreatedEvent + store.subscribe ::Namespaces::UpdateRootStatisticsWorker, to: ::Projects::ProjectDeletedEvent end private_class_method :configure! end end + +Gitlab::EventStore.prepend_mod_with('Gitlab::EventStore') |