cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksarequire 'fileutils'
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksarequire File.expand_path('../../../lib/environment_light_with_hets.rb', __FILE__)
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksarequire File.expand_path('../eye_methods.rb', __FILE__)
a15c00c37e56dac1f2cc57bfffd102758d823dc6Eugen Kuksadef hets_queue_thread_count
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa # One thread per configured hets instance, minus one for the sequential queue.
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa env 'RAILS_ENV' => Rails.env
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa env 'PID_DIR' => Rails.root.join('tmp', 'pids').to_s
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa # Create PID dir
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa FileUtils.mkdir_p(env['PID_DIR'])
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa group :sidekiq do
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa # prioritize queues:
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa # priority_push 5x as high as hets, which is 5x as high as hets-migration
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa sidekiq_process self, :"sidekiq-hets",
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa ['priority_push,25', 'hets,5', 'hets-migration,1'],
055fde49de97ddab2670728c51aa8a3176b27b2cEugen Kuksa hets_queue_thread_count
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa # one multithreaded worker for the default queue and hets_load_balancing
5e2ca0960d31fe8181b770d2b784426c45ccfea7Eugen Kuksa sidekiq_process self, :'sidekiq-default', ['default', 'hets_load_balancing'], 5
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa # one worker for the sequential queue
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa sidekiq_process self, :'sidekiq-sequential', 'sequential', 1
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa group :hets do
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa if url.match(%r{\Ahttps?://(localhost|127.0.0.1|0.0.0.0|::1)})
cb79743f740eb48d19ddd359895d190f8ec3563bEugen Kuksa hets_process self, URI(url).port