From e1016b246910aac411d4d346de40b858123dab86 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Thu, 12 Sep 2024 13:06:35 +0100 Subject: [PATCH] No need to wait_for_healthy --- lib/kamal/cli/healthcheck/poller.rb | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/lib/kamal/cli/healthcheck/poller.rb b/lib/kamal/cli/healthcheck/poller.rb index 0643c157..00646b62 100644 --- a/lib/kamal/cli/healthcheck/poller.rb +++ b/lib/kamal/cli/healthcheck/poller.rb @@ -31,31 +31,6 @@ module Kamal::Cli::Healthcheck::Poller info "Container is healthy!" end - def wait_for_unhealthy(pause_after_ready: false, &block) - attempt = 1 - max_attempts = 7 - - begin - case status = block.call - when "unhealthy" - sleep TRAEFIK_UPDATE_DELAY if pause_after_ready - else - raise Kamal::Cli::Healthcheck::Error, "container not unhealthy (#{status})" - end - rescue Kamal::Cli::Healthcheck::Error => e - if attempt <= max_attempts - info "#{e.message}, retrying in #{attempt}s (attempt #{attempt}/#{max_attempts})..." - sleep attempt - attempt += 1 - retry - else - raise - end - end - - info "Container is unhealthy!" - end - private def info(message) SSHKit.config.output.info(message)