Comments (5)
@JeremiahChurch I don't think the dependency on active_support is needed. each_slice
should do the job just as well.
from sidekiq-unique-jobs.
@JeremiahChurch I don't think the dependency on active_support is needed.
each_slice
should do the job just as well.
Great suggestion, I'll have a look at that.
from sidekiq-unique-jobs.
It looks like the result of digests[1].map in Digests#page has changed because the underlying values are stored/returned differently and that is causing the multiple rows to be returned - the 'blank' is just the time for the lock
def page(cursor: 0, pattern: SCAN_PATTERN, page_size: 100)
redis do |conn|
total_size, digests = conn.multi do |pipeline|
pipeline.zcard(key)
pipeline.zscan(key, cursor, match: pattern, count: page_size)
end
puts "\n\ndigests: #{digests[1].inspect}\n\n"
# NOTE: When debugging, check the last item in the returned array.
[
total_size.to_i,
digests[0].to_i, # next_cursor
digests[1].map { |digest, score| Lock.new(digest, time: score) }, # entries
]
end
returns
digests: ["0",
["prod_unique_jobs:2e3f377528bd7e5dafca80f993144d81", "1678393091.0208826",
"prod_unique_jobs:94f085827423f76b1f3e610bf316ad1c", "1678393399.1548831"]
]
when instead it should be nested more like:
digests: ["0",
[
["prod_unique_jobs:2e3f377528bd7e5dafca80f993144d81", "1678393091.0208826"],
["prod_unique_jobs:94f085827423f76b1f3e610bf316ad1c", "1678393399.1548831"]
]
]
a monkey patch to use activesupport's in_groups_of(2)
gets the page looking good without my changes in #762
module SidekiqUniqueJobs
class Digests
def page(cursor: 0, pattern: SCAN_PATTERN, page_size: 100)
redis do |conn|
total_size, digests = conn.multi do |pipeline|
pipeline.zcard(key)
pipeline.zscan(key, cursor, match: pattern, count: page_size)
end
# NOTE: When debugging, check the last item in the returned array.
[
total_size.to_i,
digests[0].to_i, # next_cursor
digests[1].in_groups_of(2).map { |digest, score| Lock.new(digest, time: score) }, # entries
]
end
end
end
end
from sidekiq-unique-jobs.
Can I close this then @JeremiahChurch?
from sidekiq-unique-jobs.
Can I close this then @JeremiahChurch?
@mhenrixon without that monkey patch the locks page is still broken. I'm assuming it should generally be fixed?
As-is on 8.0.2 without that patch you'll see
with the monkey patch the 'extra' lines are gone
If you're alright with active support as a depend I'll pull a PR together if you'd like?
from sidekiq-unique-jobs.
Related Issues (20)
- Reaper manager registration is subject to race conditions HOT 1
- 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 2
- 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 3
- Replace MD5 with SHA256+ HOT 2
- lock_prefix argument is not respected
- TypeError ยท Unsupported command argument type: Array HOT 1
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.