|
|
@@ -746,14 +746,14 @@ class DockerSSHBox(Sandbox):
|
|
|
containers = self.docker_client.containers.list(all=True)
|
|
|
for container in containers:
|
|
|
try:
|
|
|
- if (
|
|
|
- container.name.startswith(self.container_name)
|
|
|
- and not config.persist_sandbox
|
|
|
- ):
|
|
|
- # only remove the container we created
|
|
|
- # otherwise all other containers with the same prefix will be removed
|
|
|
- # which will mess up with parallel evaluation
|
|
|
- container.remove(force=True)
|
|
|
+ if container.name.startswith(self.container_name):
|
|
|
+ if config.persist_sandbox:
|
|
|
+ container.stop()
|
|
|
+ else:
|
|
|
+ # only remove the container we created
|
|
|
+ # otherwise all other containers with the same prefix will be removed
|
|
|
+ # which will mess up with parallel evaluation
|
|
|
+ container.remove(force=True)
|
|
|
except docker.errors.NotFound:
|
|
|
pass
|
|
|
self.docker_client.close()
|