Migrate store methods to use request.Context instead of context.Context (#24836)

Этот коммит содержится в:
Ben Schumacher
2023-10-11 13:08:55 +02:00
коммит произвёл GitHub
родитель 0d5a8b8841
Коммит 13c05a571f
127 изменённых файлов: 1030 добавлений и 921 удалений

Просмотреть файл

@@ -24,6 +24,7 @@ import (
"github.com/mattermost/mattermost/server/public/plugin"
"github.com/mattermost/mattermost/server/public/shared/i18n"
"github.com/mattermost/mattermost/server/public/shared/mlog"
"github.com/mattermost/mattermost/server/public/shared/request"
)
const (
@@ -701,7 +702,11 @@ func (wc *WebConn) ShouldSendEventToGuest(msg *model.WebSocketEvent) bool {
return true
}
canSee, err := wc.Suite.UserCanSeeOtherUser(wc.UserId, userID)
// In the future, other methods in WebConn will use a request.Context.
// For now, it's fine to create it here.
c := request.EmptyContext(wc.Platform.logger)
canSee, err := wc.Suite.UserCanSeeOtherUser(c, wc.UserId, userID)
if err != nil {
mlog.Error("webhub.shouldSendEvent.", mlog.Err(err))
return false