refactor: only update sync status columns when syncing push mirror (#39517)

`UpdatePushMirror` used `AllCols()`, so a sync could overwrite columns
changed concurrently (e.g. `interval`) with stale values. It now updates
only `last_update` and `last_error`, and is renamed to
`UpdatePushMirrorSyncStatus` to match.

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 5) <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-02 19:28:51 +00:00
1 parent cf89ecd887
commit 6dad3ad43d
3 files changed
+8 -6

No files matched your search

+2 -2
View File
@@ -109,8 +109,8 @@ func SyncPushMirror(ctx context.Context, mirrorID int64) bool {
m.LastUpdateUnix = timeutil.TimeStampNow()
if err := repo_model.UpdatePushMirror(ctx, m); err != nil {
log.Error("UpdatePushMirror [%d]: %v", m.ID, err)
if err := repo_model.UpdatePushMirrorSyncStatus(ctx, m); err != nil {
log.Error("UpdatePushMirrorSyncStatus [%d]: %v", m.ID, err)
return false
}