mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
新增:同步仓库延迟机制移除
This commit is contained in:
@@ -58,12 +58,12 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController
|
|||||||
if @sync_repository_branches.update_all({enable: params[:enable]})
|
if @sync_repository_branches.update_all({enable: params[:enable]})
|
||||||
@sync_repository_branches.each do |branch|
|
@sync_repository_branches.each do |branch|
|
||||||
branch_sync_direction = branch&.sync_repository&.sync_direction.to_i
|
branch_sync_direction = branch&.sync_repository&.sync_direction.to_i
|
||||||
TouchSyncJob.set(wait: 5.seconds).perform_later(branch) if params[:enable] && branch_sync_direction == params[:first_sync_direction].to_i
|
|
||||||
if branch_sync_direction == 1
|
if branch_sync_direction == 1
|
||||||
Reposync::UpdateBranchStatusService.call(branch&.sync_repository&.repo_name, branch.gitlink_branch_name, params[:enable])
|
Reposync::UpdateBranchStatusService.call(branch&.sync_repository&.repo_name, branch.gitlink_branch_name, params[:enable])
|
||||||
else
|
else
|
||||||
Reposync::UpdateBranchStatusService.call(branch&.sync_repository&.repo_name, branch.external_branch_name, params[:enable])
|
Reposync::UpdateBranchStatusService.call(branch&.sync_repository&.repo_name, branch.external_branch_name, params[:enable])
|
||||||
end
|
end
|
||||||
|
TouchSyncJob.perform_later(branch) if params[:enable] && branch_sync_direction == params[:first_sync_direction].to_i
|
||||||
end
|
end
|
||||||
render_ok
|
render_ok
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user