[MM-36268] Fix replication lag error on post reply (#17752)
* Fix replication lag error on post reply * Improve further by using a db transaction
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d093e102a4
Коммит
6483abd263
@@ -2320,7 +2320,14 @@ func (a *App) UpdateThreadsReadForUser(userID, teamID string) *model.AppError {
|
||||
}
|
||||
|
||||
func (a *App) UpdateThreadFollowForUser(userID, teamID, threadID string, state bool) *model.AppError {
|
||||
_, err := a.Srv().Store.Thread().MaintainMembership(userID, threadID, state, false, true, state, false)
|
||||
opts := store.ThreadMembershipOpts{
|
||||
Following: state,
|
||||
IncrementMentions: false,
|
||||
UpdateFollowing: true,
|
||||
UpdateViewedTimestamp: state,
|
||||
UpdateParticipants: false,
|
||||
}
|
||||
_, err := a.Srv().Store.Thread().MaintainMembership(userID, threadID, opts)
|
||||
if err != nil {
|
||||
return model.NewAppError("UpdateThreadFollowForUser", "app.user.update_thread_follow_for_user.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user