-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Refactor GetNextResourceIndex to make it work properly with transaction #21469
Conversation
a7a0756
to
a15c8f5
Compare
a15c8f5
to
bf48c5a
Compare
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.
Code-wise looks good. I'll trust you on the write-lock SQL code, no expertise on that.
Added tests. Ready for review & merge. |
Maybe we need to ensure |
Agree. Although the current approach also works without transaction (if there is no high concurrency access ...), I hope there is a mechanism to detect whether the context has an open transaction. If there is such mechanism, we can update the code to add the checks. |
Codecov Report
@@ Coverage Diff @@
## main #21469 +/- ##
==========================================
+ Coverage 47.43% 47.61% +0.18%
==========================================
Files 1020 1023 +3
Lines 139036 139354 +318
==========================================
+ Hits 65945 66359 +414
+ Misses 65100 64987 -113
- Partials 7991 8008 +17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
make L-G-T-M work |
* upstream/main: (32 commits) inline gitpod image (go-gitea#21494) [skip ci] Updated translations via Crowdin Do not send notifications for draft releases (go-gitea#21451) Update reverse-proxies.zh-cn.md (go-gitea#21484) Docs: Update the feature comparison to other Git Hosting Services (go-gitea#20933) Add some api integration tests (go-gitea#18872) probe if sha before exec git (go-gitea#21467) Fix incorrect notification commit url (go-gitea#21479) Localize all timestamps (go-gitea#21440) [skip ci] Updated translations via Crowdin Add system setting table with cache and also add cache supports for user setting (go-gitea#18058) Return 404 when user is not found on avatar (go-gitea#21476) Enforce grouped NuGet search results (go-gitea#21442) Display total commit count in hook message (go-gitea#21400) Refactor GetNextResourceIndex to make it work properly with transaction (go-gitea#21469) Simplify fmt-check (go-gitea#21458) update current stable version 1.17.3 changelog [skip ci] Updated translations via Crowdin Fix mermaid-related bugs (go-gitea#21431) ...
This PR is a follow up of #21469 Co-authored-by: Lauris BH <lauris@nix.lv>
Related:
This PR uses a general and stable method to generate resource index (eg: Issue Index, PR Index)
If the code looks good, I can add more tests
ps: please skip the diff, only have a look at the new code. It's entirely re-written.