-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Keep database transactions not too big #13254
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
Conversation
Also need to be nicer with missing repositories too |
Signed-off-by: Andrew Thornton <[email protected]>
See: lunny#9 |
models/migrations/v156.go
Outdated
if err := sess.Begin(); err != nil { | ||
return err | ||
} | ||
|
||
var ( | ||
gitRepoCache = make(map[int64]*git.Repository) |
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.
We may need to limit the size of this or... perhaps even better just order the releases by repository ID
Codecov Report
@@ Coverage Diff @@
## master #13254 +/- ##
==========================================
+ Coverage 42.15% 42.17% +0.01%
==========================================
Files 684 684
Lines 75540 75544 +4
==========================================
+ Hits 31847 31861 +14
+ Misses 38468 38460 -8
+ Partials 5225 5223 -2
Continue to review full report at Codecov.
|
Signed-off-by: Andrew Thornton <[email protected]>
Only cache the last repo
You don't know if the Gitea instance has how many releases which maybe over the capacity of the databases. So we should keep the transaction as a suitable size.
Also:
Fix #13255