Some logging, some code simplification, clear canvas on start
This commit is contained in:
@ -1127,6 +1127,10 @@ $(function() {
|
||||
|
||||
var initTurtle = function() {
|
||||
// todo guard clause if turtle is not required for the current exercise
|
||||
|
||||
// clear canvas
|
||||
// turtlecanvas.getContext("2d").clearRect(0, 0, turtlecanvas.width, turtlecanvas.height);
|
||||
|
||||
turtlescreen = new Turtle(websocket, turtlecanvas);
|
||||
if ($('#run').isPresent()) {
|
||||
$('#run').bind('click', hideCanvas);
|
||||
|
@ -218,7 +218,7 @@ class DockerClient
|
||||
"""
|
||||
Run commands by attaching a websocket to Docker.
|
||||
"""
|
||||
command = submission.execution_environment.send(:"run_command") % command_substitutions(filename)
|
||||
command = submission.execution_environment.run_command % command_substitutions(filename)
|
||||
create_workspace_files = proc { create_workspace_files(container, submission) }
|
||||
execute_websocket_command(command, create_workspace_files, block)
|
||||
end
|
||||
@ -227,7 +227,7 @@ class DockerClient
|
||||
"""
|
||||
Stick to existing Docker API with exec command.
|
||||
"""
|
||||
command = submission.execution_environment.send(:"test_command") % command_substitutions(filename)
|
||||
command = submission.execution_environment.test_command % command_substitutions(filename)
|
||||
create_workspace_files = proc { create_workspace_files(container, submission) }
|
||||
execute_command(command, create_workspace_files, block)
|
||||
end
|
||||
|
@ -83,10 +83,13 @@ class DockerContainerPool
|
||||
def self.refill_for_execution_environment(execution_environment)
|
||||
refill_count = [execution_environment.pool_size - @all_containers[execution_environment.id].length, config[:refill][:batch_size]].min
|
||||
if refill_count > 0
|
||||
Rails.logger.info('adding ' + refill_count.to_s + ' containers for ' + execution_environment.name )
|
||||
Rails.logger.info('Adding ' + refill_count.to_s + ' containers for execution_environment ' + execution_environment.name )
|
||||
c = refill_count.times.map { create_container(execution_environment) }
|
||||
Rails.logger.debug('Created containers: ' + c.to_s )
|
||||
@containers[execution_environment.id] += c
|
||||
@all_containers[execution_environment.id] += c
|
||||
Rails.logger.debug('@containers ' + @containers.object_id.to_s + ' has:'+ @containers[execution_environment.id].to_s)
|
||||
Rails.logger.debug('@all_containers ' + @containers.object_id.to_s + ' has:'+ @all_containers[execution_environment.id].to_s)
|
||||
#refill_count.times.map { create_container(execution_environment) }
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user