add healthcheck interval option

This commit is contained in:
acidtib
2023-05-10 20:27:21 -06:00
parent 0defcbb640
commit 9a31c20321
2 changed files with 9 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ class Mrsk::Configuration::Role
def health_check_args
if health_check_cmd.present?
optionize({ "health-cmd" => health_check_cmd, "health-interval" => "1s" })
optionize({ "health-cmd" => health_check_cmd, "health-interval" => health_check_interval })
else
[]
end
@@ -50,6 +50,13 @@ class Mrsk::Configuration::Role
options["cmd"] || http_health_check(port: options["port"], path: options["path"])
end
def health_check_interval
options = specializations["healthcheck"] || {}
options = config.healthcheck.merge(options) if running_traefik?
options["interval"] || "1s"
end
def cmd
specializations["cmd"]
end