MM-58038: Use context to call master for DeletePost (#27098)
Calling app.DeletePost immediately after creating a post is susceptible to replica lag because we were calling the replica to check for the post. We fix this by passing a context to always query master. https://mattermost.atlassian.net/browse/MM-58038 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
09c0eb7e7a
Коммит
6f3327ce0f
@@ -6122,10 +6122,10 @@ func (s *TimerLayerPostStore) GetRepliesForExport(parentID string) ([]*model.Rep
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerPostStore) GetSingle(id string, inclDeleted bool) (*model.Post, error) {
|
||||
func (s *TimerLayerPostStore) GetSingle(rctx request.CTX, id string, inclDeleted bool) (*model.Post, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.PostStore.GetSingle(id, inclDeleted)
|
||||
result, err := s.PostStore.GetSingle(rctx, id, inclDeleted)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user