|
|
|
@ -505,17 +505,18 @@ class GamesController < ApplicationController
|
|
|
|
|
res = uri_post uri, rep_params
|
|
|
|
|
uid_logger("repo_content to bridge: res is #{res}")
|
|
|
|
|
# res值:0 表示正常;-1表示有错误;-2表示代码版本库没了
|
|
|
|
|
if status == 0 && res && (res['code'] == -2 || res['code'] == -1)
|
|
|
|
|
# 删除不需要的仓库
|
|
|
|
|
begin
|
|
|
|
|
GitService.delete_repository(repo_path: @myshixun.repo_path)
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
uid_logger_error("#{e.message}")
|
|
|
|
|
# 终端循环
|
|
|
|
|
tip_exception("#{e.message}")
|
|
|
|
|
#
|
|
|
|
|
if status == 0 && res
|
|
|
|
|
# 版本库报错,修复不了
|
|
|
|
|
if res['code'] == -1 || res['code'] == -2
|
|
|
|
|
begin
|
|
|
|
|
# GitService.delete_repository(repo_path: @myshixun.repo_path) if res['code'] == -1
|
|
|
|
|
project_fork(@myshixun, @shixun.repo_path, current_user.login)
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
uid_logger_error("#{e.message}")
|
|
|
|
|
tip_exception("#{e.message}")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# fork一个新的仓库
|
|
|
|
|
# project_fork(@myshixun, @shixun.repo_path, current_user.login)
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
uid_logger_error(e.message)
|
|
|
|
|