Class: Sidekiq::LimitFetch::UnitOfWork

Inherits:
BasicFetch::UnitOfWork
  • Object
show all
Defined in:
lib/sidekiq/limit_fetch/unit_of_work.rb

Instance Method Summary collapse

Constructor Details

#initialize(queue, job) ⇒ UnitOfWork

Returns a new instance of UnitOfWork.



6
7
8
9
10
11
12
13
# File 'lib/sidekiq/limit_fetch/unit_of_work.rb', line 6

def initialize(queue, job)
  if post_6_5?
    super(queue, job, Sidekiq)
  else
    super
  end
  redis_retryable { Queue[queue_name].increase_busy }
end

Instance Method Details

#acknowledgeObject



15
16
17
18
# File 'lib/sidekiq/limit_fetch/unit_of_work.rb', line 15

def acknowledge
  redis_retryable { Queue[queue_name].decrease_busy }
  redis_retryable { Queue[queue_name].release }
end

#requeueObject



20
21
22
23
# File 'lib/sidekiq/limit_fetch/unit_of_work.rb', line 20

def requeue
  super
  acknowledge
end