|
|
|
@ -59,7 +59,9 @@ class WelcomeController < ApplicationController
|
|
|
|
|
# 同步镜像
|
|
|
|
|
if shixun.mirror_repositories.present?
|
|
|
|
|
shixun.mirror_repositories.each do |mirror|
|
|
|
|
|
LocalMirrorRepository.create!(:local_shixun_id => local_shixun.id, :mirror_repository_id => mirror.id)
|
|
|
|
|
# 本地版的mirror id和线上的可能不一样,所以按名字取,然后再存
|
|
|
|
|
# local_mirror = MirrorRepository.where(type_name: mirror.type_name).first.try(:id)
|
|
|
|
|
LocalMirrorRepository.create!(:local_shixun_id => local_shixun.id, :mirror_repository_id => mirror.id, type_name: mirror.type_name)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -124,7 +126,8 @@ class WelcomeController < ApplicationController
|
|
|
|
|
local_mirrors = LocalMirrorRepository.where(local_shixun_id: local_shixun.id)
|
|
|
|
|
if local_mirrors.present?
|
|
|
|
|
local_mirrors.each do |local_mirror|
|
|
|
|
|
ShixunMirrorRepository.create!(:shixun_id => shixun.id, :mirror_repository_id => local_mirror.mirror_repository_id)
|
|
|
|
|
local_mirror_new = MirrorRepository.where(type_name: local_mirror.try(:type_name)).first
|
|
|
|
|
ShixunMirrorRepository.create!(:shixun_id => shixun.id, :mirror_repository_id => local_mirror_new.id)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|