Fixes #20908 - postpone initialization of Dynflow runtime
In #18618, the initialization code was moved from foreman-tasks to foreman. There was however one thing done differently, where the initialization of dynflow world was moved directly to the time `Rails.application.dynflow` was called. This is not right, as there are situations where plugins go and call `Rails.application.dynflow.config` before the whole stack is prepared, which leads to database connection being opened too early, which can cause the whole lot of issues (as we've hit currently with Katello).
There was also change in the signature of `Dynflow::Rails#initialize` method, that needs to be updated.
Related issues
Bug #20908: Postpone the initialization of dynflow
Fixes #20908 - postpone initialization of Dynflow runtime
In #18618, the initialization code was moved from foreman-tasks to
foreman. There was however one thing done differently, where the
initialization of dynflow world was moved directly to the time
`Rails.application.dynflow` was called. This is not right, as there are
situations where plugins go and call `Rails.application.dynflow.config`
before the whole stack is prepared, which leads to database connection
being opened too early, which can cause the whole lot of issues (as
we've hit currently with Katello).
There was also change in the signature of `Dynflow::Rails#initialize`
method, that needs to be updated.