diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-14 20:18:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 20:18:28 +0200 |
commit | cfe3d6e9b507a9331328e55ff98a1f582abae185 (patch) | |
tree | 94b035bd2859291a16edda27822b570bdd611a35 /services/issue/issue_test.go | |
parent | Fix meilisearch not working when searching across multiple repositories (#24109) (diff) | |
download | forgejo-cfe3d6e9b507a9331328e55ff98a1f582abae185.tar.xz forgejo-cfe3d6e9b507a9331328e55ff98a1f582abae185.zip |
Make more functions use ctx instead of db.DefaultContext (#24068)
Continue the "ctx refactoring" work.
There are still a lot db.DefaultContext, incorrect context could cause
database deadlock errors.
Diffstat (limited to 'services/issue/issue_test.go')
-rw-r--r-- | services/issue/issue_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/issue/issue_test.go b/services/issue/issue_test.go index b67d2e2e79..da0e97c23c 100644 --- a/services/issue/issue_test.go +++ b/services/issue/issue_test.go @@ -44,7 +44,7 @@ func TestIssue_DeleteIssue(t *testing.T) { ID: issueIDs[2], } - err = deleteIssue(issue) + err = deleteIssue(db.DefaultContext, issue) assert.NoError(t, err) issueIDs, err = issues_model.GetIssueIDsByRepoID(db.DefaultContext, 1) assert.NoError(t, err) @@ -55,7 +55,7 @@ func TestIssue_DeleteIssue(t *testing.T) { assert.NoError(t, err) issue, err = issues_model.GetIssueByID(db.DefaultContext, 4) assert.NoError(t, err) - err = deleteIssue(issue) + err = deleteIssue(db.DefaultContext, issue) assert.NoError(t, err) assert.EqualValues(t, 2, len(attachments)) for i := range attachments { @@ -78,7 +78,7 @@ func TestIssue_DeleteIssue(t *testing.T) { assert.NoError(t, err) assert.False(t, left) - err = deleteIssue(issue2) + err = deleteIssue(db.DefaultContext, issue2) assert.NoError(t, err) left, err = issues_model.IssueNoDependenciesLeft(db.DefaultContext, issue1) assert.NoError(t, err) |