Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git gc cron should not change repo's updated_unix timestamp #15634

Closed
silverwind opened this issue Apr 27, 2021 · 1 comment · Fixed by #15637
Closed

git gc cron should not change repo's updated_unix timestamp #15634

silverwind opened this issue Apr 27, 2021 · 1 comment · Fixed by #15637
Labels
Milestone

Comments

@silverwind
Copy link
Member

Since #15177, a repo's updated_unix timestamp seen on a repo on a org page can change when the git gc cron runs which I think is undesirable because it makes it seem as thought someone pushed to the repo while actually nothing happend. It executes with this SQL:

models/repo.go:744:updateSize() [I] [SQL] SELECT COALESCE(sum(`size`),0) FROM `lfs_meta_object` WHERE (repository_id = ?) [260] - 750.016µs
.../repository/check.go:96:func1() [I] [SQL] UPDATE `repository` SET `size` = ?, `updated_unix` = ? WHERE `id`=? [41395 1619453525 260] - 2.02599ms

I think updated_unix should not be updated during the git gc cron and instead only update when actual changes happen in the repo files, e.g. push actions.

@silverwind silverwind added this to the 1.15.0 milestone Apr 27, 2021
a1012112796 added a commit to a1012112796/gitea that referenced this issue Apr 27, 2021
fix go-gitea#15634

Signed-off-by: a1012112796 <1012112796@qq.com>
@lunny
Copy link
Member

lunny commented Apr 27, 2021

I think v1.14 should also have the problem.

lunny pushed a commit that referenced this issue Apr 27, 2021
fix #15634

Signed-off-by: a1012112796 <1012112796@qq.com>
zeripath pushed a commit to zeripath/gitea that referenced this issue Apr 27, 2021
Backport go-gitea#15637

fix go-gitea#15634

Signed-off-by: a1012112796 <1012112796@qq.com>
lafriks pushed a commit that referenced this issue Apr 28, 2021
Backport #15637

fix #15634

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: a1012112796 <1012112796@qq.com>
@go-gitea go-gitea locked and limited conversation to collaborators Jun 4, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
fix go-gitea#15634

Signed-off-by: a1012112796 <1012112796@qq.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants