[MM-15799] Migrate "Session.PermanentDeleteSessionsByUser" to Sync by default (#11038)

Этот коммит содержится в:
Woolim Cho
2019-06-03 20:22:02 +09:00
коммит произвёл Hanzei
родитель d88de07b9d
Коммит d1f81842a5
5 изменённых файлов: 16 добавлений и 15 удалений

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

@@ -167,13 +167,13 @@ func (me SqlSessionStore) RemoveAllSessions() store.StoreChannel {
})
}
func (me SqlSessionStore) PermanentDeleteSessionsByUser(userId string) store.StoreChannel {
return store.Do(func(result *store.StoreResult) {
_, err := me.GetMaster().Exec("DELETE FROM Sessions WHERE UserId = :UserId", map[string]interface{}{"UserId": userId})
if err != nil {
result.Err = model.NewAppError("SqlSessionStore.RemoveAllSessionsForUser", "store.sql_session.permanent_delete_sessions_by_user.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
}
})
func (me SqlSessionStore) PermanentDeleteSessionsByUser(userId string) *model.AppError {
_, err := me.GetMaster().Exec("DELETE FROM Sessions WHERE UserId = :UserId", map[string]interface{}{"UserId": userId})
if err != nil {
return model.NewAppError("SqlSessionStore.RemoveAllSessionsForUser", "store.sql_session.permanent_delete_sessions_by_user.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
}
return nil
}
func (me SqlSessionStore) UpdateLastActivityAt(sessionId string, time int64) store.StoreChannel {