Add a few comments
This commit is contained in:
@ -121,9 +121,6 @@ class DockerClient
|
|||||||
container.status = :created
|
container.status = :created
|
||||||
container.re_use = true
|
container.re_use = true
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# - gerade benutzt? 15 Min -> Status setzen und prüfen (return beachten) -> 2 hart killen
|
|
||||||
# - schon weg?
|
|
||||||
Thread.new do
|
Thread.new do
|
||||||
timeout = Random.rand(MINIMUM_CONTAINER_LIFETIME..MAXIMUM_CONTAINER_LIFETIME) # seconds
|
timeout = Random.rand(MINIMUM_CONTAINER_LIFETIME..MAXIMUM_CONTAINER_LIFETIME) # seconds
|
||||||
sleep(timeout)
|
sleep(timeout)
|
||||||
@ -302,6 +299,7 @@ class DockerClient
|
|||||||
if container.status != :returned
|
if container.status != :returned
|
||||||
Rails.logger.info('Killing container after timeout of ' + timeout.to_s + ' seconds.')
|
Rails.logger.info('Killing container after timeout of ' + timeout.to_s + ' seconds.')
|
||||||
# send timeout to the tubesock socket
|
# send timeout to the tubesock socket
|
||||||
|
# FIXME: 2nd thread to notify user.
|
||||||
if @tubesock
|
if @tubesock
|
||||||
@tubesock.send_data JSON.dump({'cmd' => 'timeout'})
|
@tubesock.send_data JSON.dump({'cmd' => 'timeout'})
|
||||||
end
|
end
|
||||||
@ -416,6 +414,7 @@ class DockerClient
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.initialize_environment
|
def self.initialize_environment
|
||||||
|
# TODO: Move to DockerContainerPool
|
||||||
unless config[:connection_timeout] && config[:workspace_root]
|
unless config[:connection_timeout] && config[:workspace_root]
|
||||||
fail(Error, 'Docker configuration missing!')
|
fail(Error, 'Docker configuration missing!')
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user