[MM-55014][MM-55015] Add last login timestamp for users, add materialized view and refresh job to keep track of post stats for Postgres (#25152)
* [MM-55014][MM-55015] Add last login timestamp for users, add materialized view and refresh job for Postgres * Check fixes * Fix type issue * Add verification that lastlogin was updated * PR feedback * Morge'd * Morge'd again * Merge'd * Update admin setting strings * WIP * PR feedback * Oops * Fix i18n --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
41c08a3715
Коммит
1bd72bdb99
@@ -13585,6 +13585,27 @@ func (s *RetryLayerUserStore) PromoteGuestToUser(userID string) error {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) RefreshPostStatsForUsers() error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.UserStore.RefreshPostStatsForUsers()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if !isRepeatableError(err) {
|
||||
return err
|
||||
}
|
||||
tries++
|
||||
if tries >= 3 {
|
||||
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
|
||||
return err
|
||||
}
|
||||
timepkg.Sleep(100 * timepkg.Millisecond)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) ResetAuthDataToEmailForUsers(service string, userIDs []string, includeDeleted bool, dryRun bool) (int, error) {
|
||||
|
||||
tries := 0
|
||||
@@ -13858,6 +13879,27 @@ func (s *RetryLayerUserStore) UpdateFailedPasswordAttempts(userID string, attemp
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) UpdateLastLogin(userID string, lastLogin int64) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.UserStore.UpdateLastLogin(userID, lastLogin)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if !isRepeatableError(err) {
|
||||
return err
|
||||
}
|
||||
tries++
|
||||
if tries >= 3 {
|
||||
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
|
||||
return err
|
||||
}
|
||||
timepkg.Sleep(100 * timepkg.Millisecond)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) UpdateLastPictureUpdate(userID string) error {
|
||||
|
||||
tries := 0
|
||||
|
||||
Ссылка в новой задаче
Block a user