frankfurter/config/unicorn.rb

20 lines
383 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2020-04-02 15:38:07 +02:00
`rake db:prepare`
worker_process_count = (ENV['WORKER_PROCESSES'] || 4).to_i
preload_app true
worker_processes worker_process_count
timeout 10
initialized = false
before_fork do |_server, _worker|
Sequel::DATABASES.each(&:disconnect)
unless initialized
2018-10-03 15:22:52 +02:00
require 'scheduler/daemon'
Scheduler::Daemon.start
initialized = true
end
end