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
@@ -9648,11 +9648,11 @@ func (s *RetryLayerThreadStore) GetThreadFollowers(threadID string) ([]string, e
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetThreadForUser(userID string, teamID string, threadId string, extended bool) (*model.ThreadResponse, error) {
|
||||
func (s *RetryLayerThreadStore) GetThreadForUser(teamID string, threadMembership *model.ThreadMembership, extended bool) (*model.ThreadResponse, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetThreadForUser(userID, teamID, threadId, extended)
|
||||
result, err := s.ThreadStore.GetThreadForUser(teamID, threadMembership, extended)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user