Ensure a minimum limit of 1 for % boot strategy

Fixes: https://github.com/basecamp/kamal/issues/681
This commit is contained in:
Donal McBreen
2024-03-06 15:40:21 +00:00
parent c10f43e365
commit c7cfc074b6
4 changed files with 25 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ class Kamal::Configuration::Boot
limit = @options["limit"]
if limit.to_s.end_with?("%")
@host_count * limit.to_i / 100
[@host_count * limit.to_i / 100, 1].max
else
limit
end