From 1edc9a98279d48b815ed76dbcfec93dab6afeeae Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 20 Jul 2019 18:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 14e6217d8..be4448a92 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -578,19 +578,7 @@ class ShixunsController < ApplicationController onclick_time: Time.now, commit_id: commit_id) uid_logger("myshixun_id is #{myshixun.id}") - # 如果实训是纯选择题,则不需要去fork仓库以及中间层的相关操作了 - unless is_choice_type - # fork仓库 - project_fork(myshixun, @repo_path, current_user.login) - rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path ) - uid_logger("start openGameInstance") - uri = "#{cloud_bridge}/bridge/game/openGameInstance" - logger.info("end openGameInstance") - params = {tpiID: "#{myshixun.id}", tpmGitURL:rep_url, tpiRepoName: myshixun.repo_name.split("/").last} - uid_logger("openGameInstance params is #{params}") - interface_post uri, params, 83, "实训云平台繁忙(繁忙等级:83)" - end # 其它创建关卡等操作 challenges = @shixun.challenges # 之所以增加user_id是为了方便统计查询性能 @@ -605,6 +593,20 @@ class ShixunsController < ApplicationController end end + # 如果实训是纯选择题,则不需要去fork仓库以及中间层的相关操作了 + unless is_choice_type + # fork仓库 + project_fork(myshixun, @repo_path, current_user.login) + + rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path ) + uid_logger("start openGameInstance") + uri = "#{cloud_bridge}/bridge/game/openGameInstance" + logger.info("end openGameInstance") + params = {tpiID: "#{myshixun.id}", tpmGitURL:rep_url, tpiRepoName: myshixun.repo_name.split("/").last} + uid_logger("openGameInstance params is #{params}") + interface_post uri, params, 83, "实训云平台繁忙(繁忙等级:83)" + end + @current_task = myshixun.current_task(myshixun.games) uid_logger("## shixun exec: myshixun id is #{myshixun.id}") rescue Exception => e