mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 17:52:51 +00:00
improve code flow
This commit is contained in:
parent
528bf39a66
commit
b584c6b705
@ -67,12 +67,9 @@ do ->
|
||||
# Do not remove user apps.
|
||||
if _.contains(apps, containerInfo.Image)
|
||||
return false
|
||||
# Do not remove running supervisors.
|
||||
else if _.contains(supervisorImages, containerInfo.Image)
|
||||
return containerHasExited(containerInfo.Id)
|
||||
# Remove everything else.
|
||||
else
|
||||
if !_.contains(supervisorImages, containerInfo.Image)
|
||||
return true
|
||||
return containerHasExited(containerInfo.Id)
|
||||
.map (containerInfo) ->
|
||||
docker.getContainer(containerInfo.Id).removeAsync()
|
||||
.then ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user