Healthcheck polling is a CLI concern

Also, it has no instance variables, so let's just have it be a module.
This commit is contained in:
dhh
2023-09-16 11:19:38 -07:00
parent 12a82a6c58
commit 59ac59d351
6 changed files with 71 additions and 71 deletions

View File

@@ -44,14 +44,14 @@ class Kamal::Cli::App < Kamal::Cli::Base
execute *app.run(hostname: "#{host}-#{SecureRandom.hex(6)}")
Kamal::Utils::HealthcheckPoller.wait_for_healthy(pause_after_ready: true) { capture_with_info(*app.status(version: version)) }
Kamal::Cli::Healthcheck::Poller.wait_for_healthy(pause_after_ready: true) { capture_with_info(*app.status(version: version)) }
if old_version.present?
if role_config.uses_cord?
cord = capture_with_info(*app.cord(version: old_version), raise_on_non_zero_exit: false).strip
if cord.present?
execute *app.cut_cord(cord)
Kamal::Utils::HealthcheckPoller.wait_for_unhealthy(pause_after_ready: true) { capture_with_info(*app.status(version: old_version)) }
Kamal::Cli::Healthcheck::Poller.wait_for_unhealthy(pause_after_ready: true) { capture_with_info(*app.status(version: old_version)) }
end
end