Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
jasder 5 years ago
commit 8d6ddd2938

@ -28,7 +28,6 @@ module GitCommon
end
def file_content
logger.info("#################{@repo_path}, #{@path}")
@content = git_fle_content @repo_path, @path
end

@ -9,11 +9,10 @@ module GitHelper
# 版本库文件内容,带转码
def git_fle_content(repo_path, path)
begin
logger.info("##########repo_path: #{repo_path}")
logger.info("##########path: #{path}")
logger.info("git file content: repo_path is #{repo_path}, path is #{path}")
content = GitService.file_content(repo_path: repo_path, path: path)
logger.info("@@@@@@@@@@@@@@@@@@#{content}")
logger.info("git file content: content is #{content}")
decode_content = nil
if content.present?
content = content["content"] #6.24 -hs 这个为新增,因为当实训题里含有选择题时,这里会报错,undefined method `[]' for nil:NilClass
@ -34,7 +33,6 @@ module GitHelper
rescue Exception => e
Rails.logger.error(e.message)
# uid_logger_error(e.message)
raise Educoder::TipException.new("文档内容获取异常")
end
end

@ -461,6 +461,7 @@ class GamesController < ApplicationController
git_fle_content(@myshixun.shixun.repo_path, path)
rescue Exception => e
uid_logger_error("#{e.message}")
# 如果已发布的TPM实训也不能获取到内容那么肯定是版本库异常了
if @myshixun.shixun.try(:status) < 2
tip_exception("代码获取异常,请检查实训模板的评测设置是否正确")
else

Loading…
Cancel
Save