更改:回调异常处理

This commit is contained in:
yystopf 2024-05-09 17:32:43 +08:00
parent d5c8fe6e56
commit 20e8561815
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ class SyncRepository < ApplicationRecord
validates :repo_name, uniqueness: { message: "已存在" }
def unbind_reposyncer
Reposync::DeleteRepoService.call(self.repo_name)
Reposync::DeleteRepoService.call(self.repo_name) rescue nil
end
end

View File

@ -29,9 +29,9 @@ class SyncRepositoryBranch < ApplicationRecord
def unbind_reposyncer
if self.sync_repository.sync_direction.to_i == 1
Reposync::DeleteBranchService.call(self.sync_repository&.repo_name, self.gitlink_branch_name)
Reposync::DeleteBranchService.call(self.sync_repository&.repo_name, self.gitlink_branch_name) rescue nil
else
Reposync::DeleteBranchService.call(self.sync_repository&.repo_name, self.external_branch_name)
Reposync::DeleteBranchService.call(self.sync_repository&.repo_name, self.external_branch_name) rescue nil
end
end