2018-09-12 01:54:39 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-11-19 20:06:47 +01:00
|
|
|
%x(rake db:prepare)
|
2019-04-27 15:57:27 +02:00
|
|
|
|
2024-11-19 20:06:47 +01:00
|
|
|
worker_process_count = (ENV["WORKER_PROCESSES"] || 4).to_i
|
2018-09-12 01:54:39 +02:00
|
|
|
|
|
|
|
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
|
2024-11-19 20:06:47 +01:00
|
|
|
require "scheduler/daemon"
|
2018-10-03 15:22:52 +02:00
|
|
|
Scheduler::Daemon.start
|
2018-09-30 23:20:56 +02:00
|
|
|
initialized = true
|
|
|
|
end
|
2018-09-12 01:54:39 +02:00
|
|
|
end
|