第一次初始化库文件展开

This commit is contained in:
huang 2017-04-21 20:21:52 +08:00
parent d7b3b6ab01
commit f72296690f
1 changed files with 2 additions and 2 deletions

View File

@ -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?