Backup commit
This commit is contained in:
@ -172,7 +172,12 @@ class DockerClient
|
||||
rescue Timeout::Error
|
||||
{status: :timeout}
|
||||
ensure
|
||||
Concurrent::Future.execute { self.class.destroy_container(container) }
|
||||
Concurrent::Future.execute {
|
||||
#self.class.destroy_container(container)
|
||||
FileUtils.rm_rf(local_workspace_path(container)) if local_workspace_path(container)
|
||||
FileUtils.mkdir(local_workspace_path)
|
||||
DockerContainerPool.return_container(container, @execution_environment)
|
||||
}
|
||||
end
|
||||
private :send_command
|
||||
|
||||
|
@ -20,6 +20,11 @@ class DockerContainerPool
|
||||
DockerClient.create_container(execution_environment)
|
||||
end
|
||||
|
||||
def self.return_container(container, execution_environment)
|
||||
#container.start()
|
||||
@containers[execution_environment.id].push(container)
|
||||
end
|
||||
|
||||
def self.get_container(execution_environment)
|
||||
if config[:active]
|
||||
@containers[execution_environment.id].try(:shift) || create_container(execution_environment)
|
||||
|
Reference in New Issue
Block a user