frankfurter/config/unicorn.rb
Hakan Ensari e28755f76c Move migration to top of unicorn config file
There's probably a cleaner way of doing this, but it should do for now.

Fixes #4
2019-04-27 14:57:27 +01:00

20 lines
381 B
Ruby

# frozen_string_literal: true
`rake db:setup`
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
require 'scheduler/daemon'
Scheduler::Daemon.start
initialized = true
end
end