2018-09-12 01:54:39 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-27 15:57:27 +02:00
|
|
|
`rake db:setup`
|
|
|
|
|
2018-09-12 01:54:39 +02:00
|
|
|
worker_process_count = (ENV['WORKER_PROCESSES'] || 4).to_i
|
|
|
|
|
|
|
|
preload_app true
|
|
|
|
worker_processes worker_process_count
|
|
|
|
timeout 10
|
|
|
|
|
2018-09-30 23:20:56 +02:00
|
|
|
initialized = false
|
|
|
|
before_fork do |_server, _worker|
|
2018-09-12 01:54:39 +02:00
|
|
|
Sequel::DATABASES.each(&:disconnect)
|
2018-09-30 23:20:56 +02:00
|
|
|
unless initialized
|
2018-10-03 15:22:52 +02:00
|
|
|
require 'scheduler/daemon'
|
|
|
|
Scheduler::Daemon.start
|
2018-09-30 23:20:56 +02:00
|
|
|
initialized = true
|
|
|
|
end
|
2018-09-12 01:54:39 +02:00
|
|
|
end
|