Add semaphore to method calls in DockerClient

This commit is contained in:
Sebastian Serth
2020-03-22 09:54:20 +01:00
parent 1c5bd91fec
commit 2b3428b963
2 changed files with 12 additions and 4 deletions

View File

@ -36,6 +36,10 @@ class DockerContainerPool
@all_containers
end
def self.semaphore
@semaphore
end
def self.remove_from_all_containers(container, execution_environment, bypass_semaphore: false)
@semaphore.acquire unless bypass_semaphore
@all_containers[execution_environment.id] -= [container]