From d036e63bc0aea7b7a0bfa1af55cc9b54a8f4f713 Mon Sep 17 00:00:00 2001
From: Fabio Pitino <fpitino@gitlab.com>
Date: Fri, 22 Nov 2024 22:35:41 +0000
Subject: [PATCH] Document how to remove a subscriber in Gitlab::EventStore

---
 doc/development/event_store.md | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/development/event_store.md b/doc/development/event_store.md
index b25357183f34..325d41674c15 100644
--- a/doc/development/event_store.md
+++ b/doc/development/event_store.md
@@ -388,6 +388,15 @@ store.subscribe ::Security::RefreshProjectPoliciesWorker,
 
 The `handle_event` method in the subscriber worker is called for each of the events in the group.
 
+## Remove a subscriber
+
+As `Gitlab::EventStore` is backed by Sidekiq we follow the same guides for
+[removing Sidekiq workers](sidekiq/compatibility_across_updates.md#removing-worker-classes) starting
+with:
+
+- Removing the subscription in order to remove any code that enqueues the job
+- Making the subscriber worker no-op. For this we need to remove the `Gitlab::EventStore::Subscriber` module from the worker.
+
 ## Testing
 
 ### Testing the publisher
-- 
GitLab