diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 4f04cf68..77f768d1 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -570,13 +570,10 @@ class MyshixunsController < ApplicationController :create_pod => timeCost['createPod'], :pod_execute => timeCost['execute'], :test_cases => test_cases_time, :brige => timeCost['evaluateAllTime'], :return_back => return_back_time) end - # 清空代码评测信息 - msg = game.run_code_message - msg.update_column(:status => 0, :message => nil) if msg.present? logger.info("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") render :json => {:data => "success"} rescue Exception => e - render :json => {:data => "failed"} + render :json => {:data => "failed, errer_message:#{e}"} logger.error("training_task_status error: #{e}") raise ActiveRecord::Rollback end diff --git a/app/services/games_service.rb b/app/services/games_service.rb index cbc736d5..33988146 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -498,7 +498,9 @@ class GamesService # 更新评测次数 game.update_column(:evaluate_count, (game.evaluate_count.to_i + 1)) - + # 清空代码评测信息 + msg = game.run_code_message + msg.update_column(:status => 0, :message => "") if msg.present? # 更新时间是为了TPM端显示的更新,退出实训及访问实训的时候会更新 myshixun.update_column(:updated_at, Time.now)