From ae07c1b6df863155303ed836fc90874d0be852b7 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 24 May 2019 12:49:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AF=84=E6=B5=8B=E4=B8=8D?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 1 + app/services/games_service.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 7cd18a92..f6854c7a 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -536,6 +536,7 @@ class MyshixunsController < ApplicationController end logger.info("#############status: #{status}") logger.info("#############resubmit: #{resubmit}") + logger.info("sec_key is#############resubmit: #{sec_key}") record = EvaluateRecord.where(:identifier => sec_key).first logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") diff --git a/app/services/games_service.rb b/app/services/games_service.rb index b858abe6..098311f8 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -347,10 +347,11 @@ class GamesService rev = params[:rev] ? params[:rev] : "master" content_modified = 0 ActiveRecord::Base.transaction do - sec_key = generates_identifier(EvaluateRecord, 10) + # params[:evaluate] 实训评测时更新必须给的参数,需要依据该参数做性能统计,其它类型的更新可以跳过 # 自动保存的时候evaluate为0;点评测的时候为1 if params[:evaluate] == 1 + sec_key = generates_identifier(EvaluateRecord, 10) record = EvaluateRecord.create!(:user_id => current_user.id, :shixun_id => @myshixun.shixun.id, :game_id => @game.id, :identifier => sec_key) Rails.logger.warn("##game is is #{@game.id}, record id is #{record.id}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")