MM-35396 Refactor GetThreadForUser store func to take membership as argument to prevent replica lag issues and reduce joins in query (#17754)
* Update store function GetThreadForUser to use master DB to fix replica lag * Refactor GetThreadForUser store func to take membership as argument to prevent replica lag issues and reduce joins in query * Add translation * Fix test * Updates per feedback * Minor clean-up per feedback
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
24fb0033f4
Коммит
d0778486ad
@@ -7990,10 +7990,10 @@ func (s *TimerLayerThreadStore) GetThreadFollowers(threadID string) ([]string, e
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetThreadForUser(userID string, teamID string, threadId string, extended bool) (*model.ThreadResponse, error) {
|
||||
func (s *TimerLayerThreadStore) GetThreadForUser(teamID string, threadMembership *model.ThreadMembership, extended bool) (*model.ThreadResponse, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetThreadForUser(userID, teamID, threadId, extended)
|
||||
result, err := s.ThreadStore.GetThreadForUser(teamID, threadMembership, extended)
|
||||
|
||||
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user