class CronTouchSyncJob < ApplicationJob 
  queue_as :default 

  def perform
    puts "开始双向同步"
    project_ids = EduSetting.get("cron_sync_project_ids") || ""
    project_ids_array = project_ids.split(",")

    SyncRepositoryBranch.joins(:sync_repository).where(sync_repositories: {project_id: project_ids_array}).find_each do |sync_repository_branch|
      TouchSyncJob.perform_now(sync_repository_branch)
    end
  end
end