Adapt Puma config to support Puma 7
What does this MR do?
Updates config/puma.rb.example to support Puma 7 by adapting the configuration based on changes from:
The Puma configuration template needs to be adjusted to work with Puma 7:
-
Callback hooks renamed in https://github.com/puma/puma/pull/3438:
-
on_worker_boot→before_worker_boot -
on_worker_shutdown→before_worker_shutdown -
on_restart→before_restart
This MR adds a conditional block based on the Puma version to use the appropriate hooks.
-
-
Puma options access restriction in https://github.com/puma/puma/pull/3297: Puma 7 raises an exception if Puma's options are accessed before they are fully loaded. Previously we passed these options during loading of the Puma config file, which triggers this exception. These options are used to determine whether Puma is in clustered mode by checking the number of workers.
This MR uses the
set_puma_worker_countmethod added in !204104 (merged).
Related issues
Relates to #578773 (closed)