summaryrefslogtreecommitdiffstats
path: root/services/pull
diff options
context:
space:
mode:
Diffstat (limited to 'services/pull')
-rw-r--r--services/pull/check.go4
-rw-r--r--services/pull/merge.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/services/pull/check.go b/services/pull/check.go
index 830ff640b5..6e91c22f3e 100644
--- a/services/pull/check.go
+++ b/services/pull/check.go
@@ -63,7 +63,7 @@ func AddToTaskQueue(pr *issues_model.PullRequest) {
// CheckPullMergable check if the pull mergable based on all conditions (branch protection, merge options, ...)
func CheckPullMergable(stdCtx context.Context, doer *user_model.User, perm *access_model.Permission, pr *issues_model.PullRequest, manuallMerge, force bool) error {
- return db.WithTx(func(ctx context.Context) error {
+ return db.WithTx(stdCtx, func(ctx context.Context) error {
if pr.HasMerged {
return ErrHasMerged
}
@@ -122,7 +122,7 @@ func CheckPullMergable(stdCtx context.Context, doer *user_model.User, perm *acce
}
return nil
- }, stdCtx)
+ })
}
// isSignedIfRequired check if merge will be signed if required
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 56ee9c9a73..6f37a887db 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -828,7 +828,7 @@ func MergedManually(pr *issues_model.PullRequest, doer *user_model.User, baseGit
pullWorkingPool.CheckIn(fmt.Sprint(pr.ID))
defer pullWorkingPool.CheckOut(fmt.Sprint(pr.ID))
- if err := db.WithTx(func(ctx context.Context) error {
+ if err := db.WithTx(db.DefaultContext, func(ctx context.Context) error {
prUnit, err := pr.BaseRepo.GetUnitCtx(ctx, unit.TypePullRequests)
if err != nil {
return err