Reuse runners per user and execution environment

Co-authored-by: Jan-Eric Hellenberg <jan-eric.hellenberg@student.hpi.uni-potsdam.de>
Co-authored-by: Maximilian Pass <maximilian.pass@student.hpi.uni-potsdam.de>
This commit is contained in:
Konrad Hanff
2021-04-19 08:54:05 +02:00
committed by Sebastian Serth
parent 3017e46006
commit 17bd2d8726
12 changed files with 164 additions and 71 deletions

View File

@ -195,11 +195,10 @@ class Submission < ApplicationRecord
def prepared_runner
request_time = Time.now
runner = Runner.new(execution_environment, execution_environment.permitted_execution_time)
runner = Runner.for(user, exercise, execution_environment.permitted_execution_time)
copy_files_to runner
runner.waiting_time = Time.now - request_time
yield(runner) if block_given?
runner.destroy
end
def command_for(template, file)