Move copy_submission_files from runner to submission

This commit is contained in:
Konrad Hanff
2021-04-07 17:07:29 +02:00
committed by Sebastian Serth
parent 575057acd3
commit 3e6534567d
2 changed files with 9 additions and 9 deletions

View File

@ -185,10 +185,18 @@ class Submission < ApplicationRecord
private
def copy_files_to(container)
files = {}
collect_files.each do |file|
files[file.name_with_extension] = file.content
end
container.copy_files(files)
end
def prepared_container
request_time = Time.now
container = Runner.new(execution_environment, execution_environment.permitted_execution_time)
container.copy_submission_files self
copy_files_to container
container.waiting_time = Time.now - request_time
yield(container) if block_given?
container.destroy