From f72296690fbbd7cb71dc19d9a0200cdc1df56b00 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 21 Apr 2017 20:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=BA=93=E6=96=87=E4=BB=B6=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index e180ee781..bd35b5a4d 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -36,13 +36,13 @@ class GamesController < ApplicationController # 默认打开文件 logger.info("repository id is #{@repository.id}, repository's shixun_id =#{@repository.myshixun_id} shixun_id =#{@repository.shixun_id}, project_id => #{@repository.project_id}") # 验证challenge文件名的合法性 - if !challenge_path.blank? && challenge_path.include?(".") && @path.include?(".") && @type != "root" + if @path.blank? && !challenge_path.blank? && challenge_path.include?(".") && @type != "root" @path = challenge_path.strip file_content = @g.files(@myshixun.gpid, @path, @rev).content if file_content.blank? # gitlab缺陷:forked完成,短暂时间内取不了内容的,所以做一个小轮询,间隔0.1秒 # 超过2秒则失败,需通过页面刷新 - for i in 0..10 do + for i in 0..20 do sleep(0.1) file_content = @g.files(@myshixun.gpid, @path, @rev).content unless file_content.blank?