change Get() to use Master (#28842)

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Scott Bishel 2024-10-18 04:19:43 -06:00 committed by GitHub
parent 2e010837f0
commit ad50357792
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,7 +108,7 @@ func (s SqlSharedChannelStore) Get(channelId string) (*model.SharedChannel, erro
return nil, errors.Wrapf(err, "getsharedchannel_tosql")
}
if err := s.GetReplicaX().Get(&sc, squery, args...); err != nil {
if err := s.GetMasterX().Get(&sc, squery, args...); err != nil {
if err == sql.ErrNoRows {
return nil, store.NewErrNotFound("SharedChannel", channelId)
}