[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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1b1ba687bb
Коммит
8d6d1c51c2
@@ -217,6 +217,17 @@ func (me SqlSessionStore) UpdateExpiresAt(sessionId string, time int64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *SqlSessionStore) GetLastSessionRowCreateAt() (int64, error) {
|
||||
query := `SELECT CREATEAT FROM Sessions ORDER BY CREATEAT DESC LIMIT 1`
|
||||
var createAt int64
|
||||
err := me.GetReplicaX().Get(&createAt, query)
|
||||
if err != nil {
|
||||
return 0, errors.Wrapf(err, "failed to get last session creatat")
|
||||
}
|
||||
|
||||
return createAt, nil
|
||||
}
|
||||
|
||||
func (me SqlSessionStore) UpdateLastActivityAt(sessionId string, time int64) error {
|
||||
_, err := me.GetMasterX().Exec("UPDATE Sessions SET LastActivityAt = ? WHERE Id = ?", time, sessionId)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user