Sparking from https://github.com/go-gitea/gitea/issues/1937
The reason we have repository.num_issues
isn't to know how many issues there are, but to know what issue-number to assign next. It should _not_ be used in the UI to list number of issues 馃檮
Is this still an issue?
For count we should probably could use cache like I changed it in commit count
In kind of a related note, is there a method to 'reset' the issue counts? ie: num_issues
@uncled1023 As far as I know, no. The only way is to open up the database and run a query. Do note that count(...)
will break things, as num_issues
is used to select the number for the next opened issue or pull-request 馃槖 (That also needs to be fixed 馃槈 )
I don't think this is still the case but I will have to re-check
I don't think this is still the case but I will have to re-check
@sapk I can confirm it's not the case.
Here's the code used to assign the issue number (index) nowadays:
https://github.com/go-gitea/gitea/blob/cc2916dc5acea2c32372082986f8c2e2c43e55fe/models/issue.go#L901-L905
Not to say it can't be improved. 馃槃
Thanks to confirm that. I will close this issue so.
Most helpful comment
Here's the code used to assign the issue number (index) nowadays:
https://github.com/go-gitea/gitea/blob/cc2916dc5acea2c32372082986f8c2e2c43e55fe/models/issue.go#L901-L905
Not to say it can't be improved. 馃槃