mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-14 03:29:55 +00:00
feat(api): add last_sync to repository API (#37566)
This PR adds a new repository API field, `mirror_last_sync_at`, to expose the timestamp of the last successful pull mirror sync. Unlike `mirror_updated`, this field does not affect mirror scheduling and is updated only after a successful pull sync. Failed sync attempts leave the value unchanged. What changed - added `mirror_last_sync_at` to the repository API response - updated pull mirror sync flow to persist the timestamp only on successful sync - kept `mirror_updated` behavior unchanged for queue/scheduling purposes `mirror_updated` is currently tied to mirror queue behavior, so it cannot safely represent the last successful sync time. The new field makes that state explicit for API consumers without changing scheduling semantics. --------- Signed-off-by: pomidorry <106489913+Pomidorry@users.noreply.github.com> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Generated
+5
@@ -29039,6 +29039,11 @@
|
||||
"type": "string",
|
||||
"x-go-name": "MirrorInterval"
|
||||
},
|
||||
"mirror_last_sync_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"x-go-name": "MirrorLastSyncAt"
|
||||
},
|
||||
"mirror_updated": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
|
||||
@@ -9292,6 +9292,11 @@
|
||||
"type": "string",
|
||||
"x-go-name": "MirrorInterval"
|
||||
},
|
||||
"mirror_last_sync_at": {
|
||||
"format": "date-time",
|
||||
"type": "string",
|
||||
"x-go-name": "MirrorLastSyncAt"
|
||||
},
|
||||
"mirror_updated": {
|
||||
"format": "date-time",
|
||||
"type": "string",
|
||||
|
||||
Reference in New Issue
Block a user