What does this MR do?
Run only one Sidekiq job at single time with the same parameters when scheduled multiple times.
Why was this MR needed?
We are now hit by the issue that we schedule multiple jobs of the same context. All of them are being processed making it very computing intensive to process.
In all these cases it's completely fine to execute one, if there's more asking to queue, drop duplicates in queue and execute it second time.
I'm not sure about the stability of this gem, but this seems to be what we exactly need to easy the load on Sidekiq.
How it should work
If I understand that correctly this configuration should:
- You perform_async, nothing is in queue, it gets scheduled,
- The perform is executing,
- You perform_async, nothing is in queue, it gets scheduled, but since it's performing already it's added to queue,
- You perform_async, something is in queue, it gets dropped,
- The perform does finish,
- The new queued job gets scheduled.
At single time at most one job should be executed and queued in sidekiq in specific context.
Does this MR meet the acceptance criteria?
CHANGELOG entry added
API support added
Added for this feature/bug
All builds are passing
Conform by the merge request performance guides
Conform by the style guides
Branch has no merge conflicts with
master(if it does - rebase it please)
Squashed related commits together