0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-21 22:51:10 +01:00

Fix created_unix for mirroring (#32342) (#32406)

Fix #32233
Backport #32342
This commit is contained in:
Lunny Xiao 2024-11-04 19:43:30 -08:00 committed by GitHub
parent a3b7b98336
commit 7430d069b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -340,9 +340,10 @@ func pullMirrorReleaseSync(ctx context.Context, repo *repo_model.Repository, git
for _, tag := range updates {
if _, err := db.GetEngine(ctx).Where("repo_id = ? AND lower_tag_name = ?", repo.ID, strings.ToLower(tag.Name)).
Cols("sha1").
Cols("sha1", "created_unix").
Update(&repo_model.Release{
Sha1: tag.Object.String(),
CreatedUnix: timeutil.TimeStamp(tag.Tagger.When.Unix()),
}); err != nil {
return fmt.Errorf("unable to update tag %s for pull-mirror Repo[%d:%s/%s]: %w", tag.Name, repo.ID, repo.OwnerName, repo.Name, err)
}