Skip to content

Commit 417ec4c

Browse files
committed
Migrate Puma config to v7
1 parent 4bf3ddc commit 417ec4c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

config/puma.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@
7676
# Params: stdout, stderr, append?
7777
stdout_redirect 'log/puma_access.log', 'log/puma_error.log', true if %w[production].include? ENV['RAILS_ENV']
7878

79-
# Before performing a hot restart (not on phased restarts), send another watchdog message
80-
# TODO: Consider `on_booted` as well, which currently breaks with Pumactl.
81-
on_restart do
79+
# Before performing a hot restart (not on phased restarts) and directly after booting, send another watchdog message
80+
def notify_watchdog
8281
require 'puma/sd_notify'
8382
Puma::SdNotify.watchdog
8483
end
84+
before_restart { notify_watchdog }
85+
after_booted { notify_watchdog }
8586

8687
# Note on Phased Restarts:
8788
# - Phased Restarts are only supported in cluster mode with multiple workers (i.e., not in development).
8889
# - The Puma binary won't be upgraded on phased restarts, but since we have the unattended-upgrades, this is not a major issue.
89-
# - See https://github.com/casperisfine/puma/blob/HEAD/docs/restart.md.
90+
# - See https://github.com/puma/puma/blob/HEAD/docs/restart.md.

0 commit comments

Comments
 (0)