Skip to content

Commit

Permalink
Replace Redis pipeline with multi in register_job_instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
afrase authored and marcelolx committed May 16, 2024
1 parent cc4edc8 commit 1e8d186
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/sidekiq-scheduler/redis_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def self.clean_schedules_changed
def self.register_job_instance(job_name, time)
job_key = pushed_job_key(job_name)
registered, _ = Sidekiq.redis do |r|
r.pipelined do |pipeline|
pipeline.zadd(job_key, time.to_i, time.to_i)
pipeline.expire(job_key, REGISTERED_JOBS_THRESHOLD_IN_SECONDS)
r.multi do |m|
m.zadd(job_key, time.to_i, time.to_i)
m.expire(job_key, REGISTERED_JOBS_THRESHOLD_IN_SECONDS)
end
end

Expand Down

0 comments on commit 1e8d186

Please sign in to comment.