Method: Sidekiq::ProfileSet#initialize
- Defined in:
- lib/sidekiq/api.rb
#initialize ⇒ ProfileSet
This is a point in time/snapshot API, you’ll need to instantiate a new instance if you want to fetch newer records.
1341 1342 1343 1344 1345 1346 1347 1348 |
# File 'lib/sidekiq/api.rb', line 1341 def initialize @records = Sidekiq.redis do |c| # This throws away expired profiles c.zremrangebyscore("profiles", "-inf", Time.now.to_f.to_s) # retreive records, newest to oldest c.zrange("profiles", "+inf", 0, "byscore", "rev") end end |