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
Этот коммит содержится в:
Joram Wilander
2021-06-14 12:33:08 -04:00
коммит произвёл GitHub
родитель 24fb0033f4
Коммит d0778486ad
16 изменённых файлов: 119 добавлений и 46 удалений

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

@@ -283,7 +283,7 @@ type ThreadStore interface {
Update(thread *model.Thread) (*model.Thread, error)
Get(id string) (*model.Thread, error)
GetThreadsForUser(userId, teamID string, opts model.GetUserThreadsOpts) (*model.Threads, error)
GetThreadForUser(userID, teamID, threadId string, extended bool) (*model.ThreadResponse, error)
GetThreadForUser(teamID string, threadMembership *model.ThreadMembership, extended bool) (*model.ThreadResponse, error)
Delete(postID string) error
GetPosts(threadID string, since int64) ([]*model.Post, error)