Search code examples
ruby-on-railsqueuetaskjobssidekiq

How to set multiple pidfile in sidekiq.yml file?


From the official wiki page of sidekiq I found:

https://github.com/mperham/sidekiq/wiki/Advanced-Options

---
:concurrency: 5
:pidfile: tmp/pids/sidekiq.pid
staging:
  :concurrency: 10
production:
  :concurrency: 20
:queues:
  - default
  - [myqueue, 2]

Now I want to create multiple tasks using the same sidekiq.yml file. But use different pid name, such as:

  • /tmp/pids/task1.pid
  • /tmp/pids/task2.pid

How to write it in the sidekiq.yml?


Solution

  • You cannot do that. pidfile is designed to be a command line arg only.