Sha256: 6d27f3de9a104c7358c7297d40e490f489e6133cb1c6f6ea474f3ae0e3b11fb6
Contents?: true
Size: 845 Bytes
Versions: 1
Compression:
Stored size: 845 Bytes
Contents
module QPush module Web module Apis class Retries def initialize(start, count) @start = start ? start.to_i : 0 @count = count ? count.to_i : 10 @jobs = nil end def call retrieve_jobs update_jobs trim_jobs end private def retrieve_jobs @jobs = QPush.redis.with do |conn| conn.zrange(QPush.keys.delay, 0, -1, with_scores: true) end end def update_jobs @jobs.map! do |job| hash = JSON.parse(job.first, symbolize_names: true).merge(perform_at: job.last) next unless hash[:failed] hash end end def trim_jobs @jobs.compact! @jobs[@start, @count] end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
qpush-0.1.4 | lib/qpush/web/apis/retries.rb |