Run Sidekiq Jobs Without Starting Worker Process

You can add the code snippet below to config/initializers/sidekiq.rb if you don’t want to start a separate sidekiq workers.

The configuration below will make sure that the sidekiq jobs will be executed without worker process.

This is handy if you don’t want to open an extra terminal tab or tmux window for worker process.

1
2
3
4
5
# config/initializers/sidekiq.rb
if Rails.env.development?
  require 'sidekiq/testing'
  Sidekiq::Testing.inline!
end

See the official Sidekiq wiki for more information: https://github.com/mperham/sidekiq/wiki/Testing

Comments