[MM-8497] Ability to set Do Not Disturb for a specified period of time (#17680)

* Revert "Revert "[MM-8497] Ability to set Do Not Disturb for a specified period of time (#16067)" (#17657)"

This reverts commit ff383990f8.

* add debug log for recurring function

* add feature flag for dnd timed status

* refactoring changes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
darkLord19
2021-06-17 00:08:26 +05:30
коммит произвёл GitHub
родитель 6483abd263
Коммит b0bdd23d2c
27 изменённых файлов: 615 добавлений и 21 удалений

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

@@ -8296,6 +8296,26 @@ func (s *RetryLayerStatusStore) SaveOrUpdate(status *model.Status) error {
}
func (s *RetryLayerStatusStore) UpdateExpiredDNDStatuses() ([]*model.Status, error) {
tries := 0
for {
result, err := s.StatusStore.UpdateExpiredDNDStatuses()
if err == nil {
return result, nil
}
if !isRepeatableError(err) {
return result, err
}
tries++
if tries >= 3 {
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
return result, err
}
}
}
func (s *RetryLayerStatusStore) UpdateLastActivityAt(userID string, lastActivityAt int64) error {
tries := 0