I'm using sidekiq for background job and I enqueue a job like this:
SampleJob.set(wait: waiting_time.to_i.seconds).perform_later(***) ・・・①
When waiting_time
is nil,it becomes
SampleJob.set(wait: 0.seconds).perform_later(***)
Of course it works well, but I'm worried about performance because worker enqueued with wait argument is derived by poller,so I wonder if I should remove set(wait: waiting_time.to_i.seconds)
whenwaiting_time is nil.
i.e.)
if waiting_time.present? SampleJob.set(wait: waiting_time.to_i.seconds).perform_later(***)else SampleJob.perform_later(***)end ・・・②
Is there any differences in performance or speed between ① and ②?Thank you in advance.