设置关卡的超时时间

dev_aliyun
daiao 5 years ago
parent c5515f4f1f
commit 6390815ab5

@ -530,7 +530,7 @@ class GamesService
game = Game.select([:myshixun_id, :status, :challenge_id, :id, :evaluate_count]).find_by_identifier(params[:identifier])
myshixun = Myshixun.select([:updated_at, :gpid, :id, :shixun_id]).find(game.myshixun_id)
shixun = Shixun.select([:id, :evaluate_script, :webssh, :exec_time, :sigle_training, :identifier, :status]).find(myshixun.shixun_id)
game_challenge = Challenge.select([:id, :position, :picture_path]).find(game.challenge_id)
game_challenge = Challenge.select([:id, :position, :picture_path, :exec_time]).find(game.challenge_id)
# 更新评测次数
game.update_column(:evaluate_count, (game.evaluate_count.to_i + 1))
@ -573,7 +573,7 @@ class GamesService
params = {:tpiID => "#{myshixun.id}", :tpiGitURL => "#{gitUrl}", :buildID => "#{taskId}",:instanceChallenge => "#{step}",
:testCases => "#{testCases}", :resubmit => "#{resubmit}", :times => params[:first].to_i, :podType => shixun.webssh,
:containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}", :tpmScript => "#{tpmScript}",
:timeLimit => "#{shixun.exec_time}", :content_modified => content_modified, :persistenceName => shixun.identifier,
:timeLimit => "#{game_challenge.exec_time}", :content_modified => content_modified, :persistenceName => shixun.identifier,
:isPublished => (shixun.status < 2 ? 0 : 1), :sec_key => params[:sec_key]}
# 评测有文件输出的需要特殊传字段 path表示文件存储的位置

Loading…
Cancel
Save