mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 23:16:52 +02:00
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:
3 files changed
+8
-6
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user