[MM-40917] - Inactive Server Email Notification (#19374)

* [MM-40917] - Inactive Server Email Notification

* add email template

* make store layers

* add some store tests

* fix translations

* fix logic

* improve

* fix lint

* feedback-impl

* fix wrong text

* optimize queries

* move feature flag check

* feedback impl-1

* add line

* feedback impl

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Allan Guwatudde
2022-02-22 20:41:58 +03:00
коммит произвёл GitHub
родитель 1b1ba687bb
Коммит 8d6d1c51c2
17 изменённых файлов: 1038 добавлений и 1 удалений

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

@@ -4970,6 +4970,22 @@ func (s *TimerLayerPostStore) GetFlaggedPostsForTeam(userID string, teamID strin
return result, err
}
func (s *TimerLayerPostStore) GetLastPostRowCreateAt() (int64, error) {
start := timemodule.Now()
result, err := s.PostStore.GetLastPostRowCreateAt()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetLastPostRowCreateAt", success, elapsed)
}
return result, err
}
func (s *TimerLayerPostStore) GetMaxPostSize() int {
start := timemodule.Now()
@@ -6553,6 +6569,22 @@ func (s *TimerLayerSessionStore) Get(ctx context.Context, sessionIDOrToken strin
return result, err
}
func (s *TimerLayerSessionStore) GetLastSessionRowCreateAt() (int64, error) {
start := timemodule.Now()
result, err := s.SessionStore.GetLastSessionRowCreateAt()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.GetLastSessionRowCreateAt", success, elapsed)
}
return result, err
}
func (s *TimerLayerSessionStore) GetSessions(userID string) ([]*model.Session, error) {
start := timemodule.Now()