Fix scale when containers exit immediately
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
e35bf47a7f
commit
755c49b500
2 changed files with 8 additions and 5 deletions
|
|
@ -228,11 +228,9 @@ class Service(object):
|
|||
sorted_running_containers = sorted(
|
||||
running_containers,
|
||||
key=attrgetter('number'))
|
||||
parallel_stop(
|
||||
sorted_running_containers[-num_to_stop:],
|
||||
dict(timeout=timeout))
|
||||
|
||||
parallel_remove(self.containers(stopped=True), {})
|
||||
containers_to_stop = sorted_running_containers[-num_to_stop:]
|
||||
parallel_stop(containers_to_stop, dict(timeout=timeout))
|
||||
parallel_remove(containers_to_stop, {})
|
||||
|
||||
def create_container(self,
|
||||
one_off=False,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue