Method: Sidekiq::Job::ClassMethods#drain
- Defined in:
- lib/sidekiq/test_api.rb
#drain ⇒ Object
Drain and run all jobs for this worker
266 267 268 269 270 271 272 |
# File 'lib/sidekiq/test_api.rb', line 266 def drain while jobs.any? next_job = jobs.first Queues.delete_for(next_job["jid"], next_job["queue"], to_s) process_job(next_job) end end |