forked from Trustie/forgeplus
新增:只跑固定几个项目的定时同步
This commit is contained in:
parent
d89401bded
commit
58a1dc6799
|
|
@ -3,7 +3,10 @@ class CronTouchSyncJob < ApplicationJob
|
|||
|
||||
def perform
|
||||
puts "开始双向同步"
|
||||
SyncRepositoryBranch.find_each do |sync_repository_branch|
|
||||
project_ids = EduSetting.get("cron_sync_project_ids") || ""
|
||||
project_ids_array = project_ids.split(",")
|
||||
|
||||
SyncRepositoryBranch.joins(:sync_repository).where(sync_repository: {project_id: project_ids_array}).find_each do |sync_repository_branch|
|
||||
TouchSyncJob.perform_now(sync_repository_branch)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue