Changed the way we empty the working dir after continaer is returnned in pool
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
require 'concurrent'
|
require 'concurrent'
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
class DockerClient
|
class DockerClient
|
||||||
CONTAINER_WORKSPACE_PATH = '/workspace'
|
CONTAINER_WORKSPACE_PATH = '/workspace'
|
||||||
@ -55,7 +56,7 @@ class DockerClient
|
|||||||
container
|
container
|
||||||
rescue Docker::Error::NotFoundError => error
|
rescue Docker::Error::NotFoundError => error
|
||||||
destroy_container(container)
|
destroy_container(container)
|
||||||
(tries += 1) <= RETRY_COUNT ? retry : raise(error)
|
#(tries += 1) <= RETRY_COUNT ? retry : raise(error)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_workspace_files(container, submission)
|
def create_workspace_files(container, submission)
|
||||||
@ -164,8 +165,9 @@ class DockerClient
|
|||||||
|
|
||||||
def return_container(container)
|
def return_container(container)
|
||||||
local_workspace_path = self.class.local_workspace_path(container)
|
local_workspace_path = self.class.local_workspace_path(container)
|
||||||
FileUtils.rm_rf(local_workspace_path) if local_workspace_path
|
#FileUtils.rm_rf(local_workspace_path) if local_workspace_path
|
||||||
FileUtils.mkdir(local_workspace_path)
|
Pathname.new(local_workspace_path).children.each{ |p| p.rmtree}
|
||||||
|
#FileUtils.mkdir(local_workspace_path)
|
||||||
DockerContainerPool.return_container(container, @execution_environment)
|
DockerContainerPool.return_container(container, @execution_environment)
|
||||||
end
|
end
|
||||||
private :return_container
|
private :return_container
|
||||||
|
Reference in New Issue
Block a user