[Prod] Configure sidekiq through env variables

This commit is contained in:
Earlopain 2023-04-15 21:07:52 +02:00
parent eb8e402152
commit 7bb412c608
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
2 changed files with 5 additions and 9 deletions

View File

@ -1,4 +1,4 @@
server: bin/rails server -p 9000 -b 0.0.0.0
# server: bundle exec unicorn -c config/unicorn/development.rb
jobs: bundle exec sidekiq -c 1 -q low_prio -q tags -q default -q high_prio -q video
jobs: SIDEKIQ_QUEUES="low_prio:1;tags:2;default:3;high_prio:5" bundle exec sidekiq
cron: run-parts /etc/periodic/daily && crond -f

View File

@ -1,6 +1,5 @@
---
:verbose: false
:concurrency: 5
# Set timeout to 8 on Heroku, longer if you manage your own systems.
:timeout: 30
@ -9,11 +8,8 @@
# even put in dynamic logic, like a host-specific queue.
# http://www.mikeperham.com/2013/11/13/advanced-sidekiq-host-specific-queues/
:queues:
- [low_prio, 1]
- [tags, 2]
- [default, 3]
- [high_prio, 5]
<% ENV.fetch("SIDEKIQ_QUEUES").split(";").map { |e| e.split(":") }.each do |queue, priority| %>
- [<%= queue %>, <%= priority %>]
<% end %>
# you can override concurrency based on environment
production:
:concurrency: 15
:concurrency: <%= ENV.fetch("SIDEKIQ_CONCURRENCY", 5) %>