mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Move sync mirror actions to mirror service package (#8518)
* move sync mirror actions to mirror service * fix go.mod * fix lint * fix lint
This commit is contained in:
@@ -329,16 +329,16 @@ func SyncMirrors() {
|
||||
|
||||
// Create reference
|
||||
if result.oldCommitID == gitShortEmptySha {
|
||||
if err = models.MirrorSyncCreateAction(m.Repo, result.refName); err != nil {
|
||||
log.Error("MirrorSyncCreateAction [repo_id: %d]: %v", m.RepoID, err)
|
||||
if err = SyncCreateAction(m.Repo, result.refName); err != nil {
|
||||
log.Error("SyncCreateAction [repo_id: %d]: %v", m.RepoID, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// Delete reference
|
||||
if result.newCommitID == gitShortEmptySha {
|
||||
if err = models.MirrorSyncDeleteAction(m.Repo, result.refName); err != nil {
|
||||
log.Error("MirrorSyncDeleteAction [repo_id: %d]: %v", m.RepoID, err)
|
||||
if err = SyncDeleteAction(m.Repo, result.refName); err != nil {
|
||||
log.Error("SyncDeleteAction [repo_id: %d]: %v", m.RepoID, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -359,13 +359,13 @@ func SyncMirrors() {
|
||||
log.Error("CommitsBetweenIDs [repo_id: %d, new_commit_id: %s, old_commit_id: %s]: %v", m.RepoID, newCommitID, oldCommitID, err)
|
||||
continue
|
||||
}
|
||||
if err = models.MirrorSyncPushAction(m.Repo, models.MirrorSyncPushActionOptions{
|
||||
if err = SyncPushAction(m.Repo, SyncPushActionOptions{
|
||||
RefName: result.refName,
|
||||
OldCommitID: oldCommitID,
|
||||
NewCommitID: newCommitID,
|
||||
Commits: models.ListToPushCommits(commits),
|
||||
}); err != nil {
|
||||
log.Error("MirrorSyncPushAction [repo_id: %d]: %v", m.RepoID, err)
|
||||
log.Error("SyncPushAction [repo_id: %d]: %v", m.RepoID, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user