diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-07-22 22:14:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-22 22:14:27 +0800 |
commit | b167f35113e643ccdb17a2dde55bdec5960b284b (patch) | |
tree | 99a6e53bf1a9d4c9199c19113650cc48a8c1fd0e /services/pull/check_test.go | |
parent | c42b71877edb4830b9573101d20853222d66fb3c (diff) | |
download | gitea-b167f35113e643ccdb17a2dde55bdec5960b284b.tar.gz gitea-b167f35113e643ccdb17a2dde55bdec5960b284b.zip |
Add context parameter to some database functions (#26055)
To avoid deadlock problem, almost database related functions should be
have ctx as the first parameter.
This PR do a refactor for some of these functions.
Diffstat (limited to 'services/pull/check_test.go')
-rw-r--r-- | services/pull/check_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/pull/check_test.go b/services/pull/check_test.go index 57ccb20033..4a99859f5a 100644 --- a/services/pull/check_test.go +++ b/services/pull/check_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "code.gitea.io/gitea/models/db" issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/queue" @@ -36,7 +37,7 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { assert.NoError(t, err) pr := unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2}) - AddToTaskQueue(pr) + AddToTaskQueue(db.DefaultContext, pr) assert.Eventually(t, func() bool { pr = unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2}) |