第一次初始化库文件展开
This commit is contained in:
parent
d7b3b6ab01
commit
f72296690f
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Reference in New Issue