Customizable stop wait time

Configurable via a global `stop_wait_time` option.
The default is `10` which matches Docker defaults.
This commit is contained in:
Jacopo
2023-03-24 14:57:49 +01:00
parent 1f196045a9
commit 9b43a6b23b
4 changed files with 16 additions and 4 deletions

View File

@@ -27,10 +27,12 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
docker :start, service_with_version_and_destination_and_role
end
DEFAULT_STOP_WAIT_TIME = 10
def stop(version: nil)
pipe \
version ? container_id_for_version(version) : current_container_id,
xargs(docker(:stop))
xargs(docker(:stop, "-t", config.stop_wait_time || DEFAULT_STOP_WAIT_TIME))
end
def info