Skip to content

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

Merged
merged 6 commits into from
Oct 22, 2020

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 22, 2020

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

@lunny lunny mentioned this pull request Oct 22, 2020
@zeripath
Copy link
Contributor

Also need to be nicer with missing repositories too

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 22, 2020
Signed-off-by: Andrew Thornton <[email protected]>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 22, 2020
@zeripath
Copy link
Contributor

See: lunny#9

@zeripath zeripath added this to the 1.14.0 milestone Oct 22, 2020
if err := sess.Begin(); err != nil {
return err
}

var (
gitRepoCache = make(map[int64]*git.Repository)
Copy link
Contributor

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-io
Copy link

Codecov Report

Merging #13254 into master will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
models/migrations/v156.go 0.00% <0.00%> (ø)
modules/migrations/gitea_downloader.go 0.93% <0.00%> (-0.01%) ⬇️
services/pull/pull.go 40.78% <0.00%> (ø)
services/pull/patch.go 55.68% <0.00%> (+1.70%) ⬆️
services/pull/temp_repo.go 29.78% <0.00%> (+3.19%) ⬆️
services/pull/check.go 52.55% <0.00%> (+3.64%) ⬆️
modules/util/timer.go 85.71% <0.00%> (+42.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7deea0...bf7b43a. Read the comment docs.

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath
Copy link
Contributor

lunny#10

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 22, 2020
@techknowlogick techknowlogick merged commit be82b8f into go-gitea:master Oct 22, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@lunny lunny deleted the lunny/release_commit branch August 24, 2023 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with recent Migration[156]
6 participants