[MM-49989] Pass a context.Context to Client4 methods (#22922)
* Migrate all method in model/client4.go to accept a context.Context * Fix th.*Client * Fix remaining issues * Empty commit to triger CI * Fix test * Add cancellation test * Test that returned error is context.Canceled * Fix bad merge * Update mmctl code --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7116e9267a
Коммит
6c82605df0
@@ -4,6 +4,7 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -45,7 +46,7 @@ func (s *MmctlE2ETestSuite) TestExtractRunCmdF() {
|
||||
info, err := file.Stat()
|
||||
s.Require().NoError(err)
|
||||
|
||||
us, _, err := s.th.SystemAdminClient.CreateUpload(&model.UploadSession{
|
||||
us, _, err := s.th.SystemAdminClient.CreateUpload(context.Background(), &model.UploadSession{
|
||||
ChannelId: s.th.BasicChannel.Id,
|
||||
Filename: info.Name(),
|
||||
FileSize: info.Size(),
|
||||
@@ -53,7 +54,7 @@ func (s *MmctlE2ETestSuite) TestExtractRunCmdF() {
|
||||
s.Require().NoError(err)
|
||||
s.Require().NotNil(us)
|
||||
|
||||
_, _, err = s.th.SystemAdminClient.UploadData(us.Id, file)
|
||||
_, _, err = s.th.SystemAdminClient.UploadData(context.Background(), us.Id, file)
|
||||
s.Require().NoError(err)
|
||||
|
||||
cmd := &cobra.Command{}
|
||||
|
||||
Ссылка в новой задаче
Block a user