Comments (1)
Yes, redis suggests a simpler algorithm, but I needed more, so I dreamed up my own algorithm.
People requested that they lock only during runtime, not during queuing, meaning sidekiq picks the job up, runs it through the server middleware, and the server constrains any duplicates from running simultaneously.
People also requested that the locks stay active as long as the job is in Sidekiq. If you want something simpler, I recommend https://github.com/rwojsznis/sidekiq-lock or sidekiq-pro if you have the money.
I don't think you should schedule a new job as part of the old one still running. Sidekiq needs to be done processing the current job when you push the next one. Preferably, you should do that outside of this "Redis transaction" or "unit of work."
The queued and primed keys are used to block as part of processing the job. The push of "1" is accompanied by an expiration to ensure that listeners on the queued key can keep listening.
There are things I can do to improve your situation, but you know you are doing an infinite recursion, right?
from sidekiq-unique-jobs.
Related Issues (20)
- Should client middleware also be added to the Sidekiq server config? HOT 2
- After sidekiq shutdown (with running job) lock digest is not pushned back HOT 8
- Returning same job id HOT 7
- Sidekiq 7: Unsupported command argument type: TrueClass HOT 1
- register_reaper_process nx: true crash Sidekiq on startup HOT 2
- uniquejobs:digests sorted set seems to grow forever HOT 3
- should respond to `has_valid_sidekiq_options?` HOT 4
- Compatibility with Sidekiq7 HOT 4
- until_and_while_executing not entering perform method on initial run HOT 7
- No 'Changelog' link is being displayed on https://rubygems.org/gems/sidekiq-unique-jobs HOT 1
- Documentation of lock_ttl is inconsistent HOT 5
- Catched a deadlock on Sidekiq 7+ set up using middleware.
- Conflicts with sidekiq-lock gem HOT 4
- Read Timeouts and high CPU spike after upgrading from 8.0.5 to 8.0.10 HOT 9
- Issue with until_and_while_executing lock when job is not enqueued through sidekiq
- until_and_while_executing with separate server and client lock_args broken since 8.0.8 HOT 7
- Replace MD5 with SHA256+ HOT 2
- lock_prefix argument is not respected
- TypeError ยท Unsupported command argument type: Array HOT 1
- clarify replace strategy docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-unique-jobs.