-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Decrease the num_stars when deleting a repo #11954
Conversation
fix go-gitea#11949 Signed-off-by: a1012112796 <1012112796@qq.com>
I don't think this fixes described issue |
Reason? Thanks 🤔 |
@lafriks Maybe should recalculate the stars number when deieteing repo. is it right ? Thanks |
I was more talking about issue you linked. But recalculation imho seems more reasonable otherwise it will not fix already invalid counts |
Hmm, Maybe should add migration to recalculate all , recalculate stars when deleting repo will cost too much time .. |
Migration should be batched, see other migrations for examples |
Co-authored-by: Lauris BH <lauris@nix.lv>
401fe54
to
b1347b8
Compare
We should backport this without migration, only bugfix itself |
@lunny How about this change? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also for a big instance which has many users, the transaction maybe failed. So it's more reasonable to commit every 100 or 200 updates.
@lunny Please review again, Thanks |
make L-G-T-M work. |
@a1012112796 thanks for PR :) Please send backport to release/v1.12 branch |
* Decrease the num_stars when deleting a repo fix go-gitea#11949 Signed-off-by: a1012112796 <1012112796@qq.com> * Add migration * use batch * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv> * fix lint * fix lint * fix ci * fix ci2 * add doctor * duplicate code * fix migration * fix some nits * add start Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Decrease the num_stars when deleting a repo fix #11949 Signed-off-by: a1012112796 <1012112796@qq.com> * Add migration * use batch * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv> * fix lint * fix lint * fix ci * fix ci2 * add doctor * duplicate code * fix migration * fix some nits * add start Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Decrease the num_stars when deleting a repo fix go-gitea#11949 Signed-off-by: a1012112796 <1012112796@qq.com> * Add migration * use batch * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv> * fix lint * fix lint * fix ci * fix ci2 * add doctor * duplicate code * fix migration * fix some nits * add start Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
As title.