Skip to content

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

  1. Make sure that Sidekiq is working locally with the new branch code gdk restart rails-background-jobs
  2. 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
  1. Trigger the SyncEvents worker only once
Namespaces::ProcessSyncEventsWorker.perform_async
  1. The number of the sync_events records in the database will go back to 0.
[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.

Related to #366583 (closed)

Edited by Omar Qunsul

Merge request reports

Loading