MM-23093 Implement Server Setup telemetry - server configuration (#14374)

* added advanced first day diagnostics reporting

* typo

* config corrected

* defaults

* moved from config to system db table

* missing file

* added error handling

* tests

* typos

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Eli Yukelzon
2020-04-30 18:18:12 +03:00
коммит произвёл GitHub
родитель 278c295869
Коммит 7800116429
12 изменённых файлов: 93 добавлений и 13 удалений

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

@@ -142,6 +142,18 @@ func (a *App) getSystemInstallDate() (int64, *model.AppError) {
return value, nil
}
func (a *App) getFirstServerRunTimestamp() (int64, *model.AppError) {
systemData, appErr := a.Srv().Store.System().GetByName(model.SYSTEM_FIRST_SERVER_RUN_TIMESTAMP_KEY)
if appErr != nil {
return 0, appErr
}
value, err := strconv.ParseInt(systemData.Value, 10, 64)
if err != nil {
return 0, model.NewAppError("getFirstServerRunTimestamp", "app.system_install_date.parse_int.app_error", nil, err.Error(), http.StatusInternalServerError)
}
return value, nil
}
func (a *App) Srv() *Server {
return a.srv
}