Revision 29fe60a8
Added by Adam Ruzicka about 4 years ago
config/puma/production.rb | ||
---|---|---|
# The default is "0" for puma. Recommending "2" for foreman
|
||
#
|
||
workers ENV.fetch('FOREMAN_PUMA_WORKERS', 2).to_i
|
||
|
||
on_worker_boot do
|
||
dynflow = ::Rails.application.dynflow
|
||
dynflow.initialize! unless dynflow.config.lazy_initialization
|
||
end
|
Also available in: Unified diff
Fixes #29258 - Initialize dynflow in puma workers
When running puma in clustered mode in production, Dynflow would get initialized
in the master process before workers were forked off and due to CoW the workers
would use the same world id.
With this commit we will eagerly initialize Dynflow only when running under
Passenger. When running under puma, we will initialize Dynflow in workers.
Co-Authored-By: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>