use sidekiq

This commit is contained in:
Pete Matsyburka
2024-06-18 16:51:42 +03:00
parent 9539c476c0
commit 3034c00bb3
41 changed files with 332 additions and 132 deletions
+10 -3
View File
@@ -5,7 +5,9 @@
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
require_relative 'dotenv'
max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 15)
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
@@ -41,5 +43,10 @@ workers ENV.fetch('WEB_CONCURRENCY', 0)
#
# preload_app!
# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
if ENV['MULTITENANT'] != 'true' || ENV['DEMO'] == 'true'
require_relative '../lib/puma/plugin/redis_server'
require_relative '../lib/puma/plugin/sidekiq_embed'
plugin :sidekiq_embed
plugin :redis_server
end