mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
GH-11385 Migrate User.AnalyticsGetInactiveUsersCount to Sync by default (#11432)
* GH-11385 Migrate User.AnalyticsGetInactiveUsersCount to Sync by default * GH-11385 fix TestGetAnalyticsOld
This commit is contained in:
committed by
Christopher Speller
parent
46f2b18e4f
commit
3bce32bbcf
@@ -1417,14 +1417,12 @@ func (us SqlUserStore) performSearch(query sq.SelectBuilder, term string, option
|
||||
return result
|
||||
}
|
||||
|
||||
func (us SqlUserStore) AnalyticsGetInactiveUsersCount() store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
if count, err := us.GetReplica().SelectInt("SELECT COUNT(Id) FROM Users WHERE DeleteAt > 0"); err != nil {
|
||||
result.Err = model.NewAppError("SqlUserStore.AnalyticsGetInactiveUsersCount", "store.sql_user.analytics_get_inactive_users_count.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
} else {
|
||||
result.Data = count
|
||||
}
|
||||
})
|
||||
func (us SqlUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.AppError) {
|
||||
count, err := us.GetReplica().SelectInt("SELECT COUNT(Id) FROM Users WHERE DeleteAt > 0")
|
||||
if err != nil {
|
||||
return int64(0), model.NewAppError("SqlUserStore.AnalyticsGetInactiveUsersCount", "store.sql_user.analytics_get_inactive_users_count.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (us SqlUserStore) AnalyticsGetSystemAdminCount() store.StoreChannel {
|
||||
|
||||
Reference in New Issue
Block a user