summaryrefslogtreecommitdiffstats
path: root/services/pull/check.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-04-28 13:48:48 +0200
committerGitHub <noreply@github.com>2022-04-28 13:48:48 +0200
commit06e4687cecaed41500b653e5b8685f48b8b18310 (patch)
treea98dd6d0139ba5d89c7e08d3c52930d66a77119b /services/pull/check.go
parent332b2ecd214a79b49f3798f4f27fe02b23a17bf8 (diff)
downloadgitea-06e4687cecaed41500b653e5b8685f48b8b18310.tar.gz
gitea-06e4687cecaed41500b653e5b8685f48b8b18310.zip
more context for models (#19511)
make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
Diffstat (limited to 'services/pull/check.go')
-rw-r--r--services/pull/check.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/check.go b/services/pull/check.go
index 29dc88e0f0..f7747dfa2a 100644
--- a/services/pull/check.go
+++ b/services/pull/check.go
@@ -227,7 +227,7 @@ func getMergeCommit(ctx context.Context, pr *models.PullRequest) (*git.Commit, e
// manuallyMerged checks if a pull request got manually merged
// When a pull request got manually merged mark the pull request as merged
func manuallyMerged(ctx context.Context, pr *models.PullRequest) bool {
- if err := pr.LoadBaseRepo(); err != nil {
+ if err := pr.LoadBaseRepoCtx(ctx); err != nil {
log.Error("PullRequest[%d].LoadBaseRepo: %v", pr.ID, err)
return false
}
@@ -317,7 +317,7 @@ func testPR(id int64) {
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("Test PR[%d] from patch checking queue", id))
defer finished()
- pr, err := models.GetPullRequestByID(id)
+ pr, err := models.GetPullRequestByID(ctx, id)
if err != nil {
log.Error("GetPullRequestByID[%d]: %v", id, err)
return