mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
新增:加入同步方向逻辑
This commit is contained in:
@@ -22,5 +22,17 @@ class SyncRepositoryBranch < ApplicationRecord
|
||||
|
||||
belongs_to :sync_repository
|
||||
|
||||
before_destroy :unbind_reposyncer
|
||||
|
||||
enum sync_status: {success: 1, failure: 2}
|
||||
|
||||
|
||||
def unbind_reposyncer
|
||||
if self.sync_repository.sync_direction.to_i == 1
|
||||
Reposync::DeleteRepoService.call(self.sync_repository&.repo_name, self.gitlink_branch_name)
|
||||
else
|
||||
Reposync::DeleteRepoService.call(self.sync_repository&.repo_name, self.external_branch_name)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user