Moving diagnostics into a service (#14832)
* Moving diagnostics into a service * Fixing golint checks * Fixing tests * Renaming from diagnostics to telemetry * Adding missing files * Initializing telemetry earlier in the server startup * Fixing tests * Adding a log for the telemetryID initialization error * Addressing PR review comments * Fixing merge problem * Removing some extra Diagnostics mentions * Making tests pass
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f0eb67fa0d
Коммит
44079785eb
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
)
|
||||
|
||||
const ADVANCED_PERMISSIONS_MIGRATION_KEY = "AdvancedPermissionsMigrationComplete"
|
||||
const EMOJIS_PERMISSIONS_MIGRATION_KEY = "EmojisPermissionsMigrationComplete"
|
||||
const GUEST_ROLES_CREATION_MIGRATION_KEY = "GuestRolesCreationMigrationComplete"
|
||||
const SYSTEM_CONSOLE_ROLES_CREATION_MIGRATION_KEY = "SystemConsoleRolesCreationMigrationComplete"
|
||||
@@ -20,7 +19,7 @@ const SYSTEM_CONSOLE_ROLES_CREATION_MIGRATION_KEY = "SystemConsoleRolesCreationM
|
||||
// This function migrates the default built in roles from code/config to the database.
|
||||
func (a *App) DoAdvancedPermissionsMigration() {
|
||||
// If the migration is already marked as completed, don't do it again.
|
||||
if _, err := a.Srv().Store.System().GetByName(ADVANCED_PERMISSIONS_MIGRATION_KEY); err == nil {
|
||||
if _, err := a.Srv().Store.System().GetByName(model.ADVANCED_PERMISSIONS_MIGRATION_KEY); err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ func (a *App) DoAdvancedPermissionsMigration() {
|
||||
}
|
||||
|
||||
system := model.System{
|
||||
Name: ADVANCED_PERMISSIONS_MIGRATION_KEY,
|
||||
Name: model.ADVANCED_PERMISSIONS_MIGRATION_KEY,
|
||||
Value: "true",
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user