Fixing Deduplication of Namespaces and Projects ProcessSyncEventsWorker
What does this MR do and why?
The same goal as this MR, with fixed the rescheduling of the job, to address the issue that is explained here: #366583 (closed)
How to set up and validate locally
- Make sure that Sidekiq is working locally with the new branch code
gdk restart rails-background-jobs
- From Rails Console, create a big number of
Namespaces::SyncEvent
records.
ActiveRecord::Base.logger = nil
3500.times { Namespaces::SyncEvent.create!(namespace_id: Namespace.first.id) }; nil
- Trigger the SyncEvents worker only once
Namespaces::ProcessSyncEventsWorker.perform_async
- The number of the
sync_events
records in the database will go back to0
.
[136] pry(main)> Namespaces::SyncEvent.count
=> 0
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #366583 (closed)
Edited by Omar Qunsul