Channel index fix (#22947)
* WIP * Fetched ES index for type checking * WIP * Moved migration key to model * CI * CI * Fixed existing tests * Updated einterface mocks * CI * WIP * Reverted test makefile changes * Fixed error level * CI * Not attempting to launch job if not enterprise ready * CI * Fixing job trigger condition * CI * Updated eemocks * CI
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
08bb7933aa
Коммит
3db6bb016e
@@ -559,6 +559,24 @@ func (s *Server) doPostPriorityConfigDefaultTrueMigration() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) doElasticsearchFixChannelIndex() {
|
||||
// If the migration is already marked as completed, don't do it again.
|
||||
if _, err := s.Store().System().GetByName(model.MigrationKeyElasticsearchFixChannelIndex); err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
license := s.License()
|
||||
if model.BuildEnterpriseReady != "true" || license == nil || !*license.Features.Elasticsearch {
|
||||
mlog.Info("Skipping triggering Elasticsearch channel index fix job as build is not Enterprise ready")
|
||||
return
|
||||
}
|
||||
|
||||
if _, appErr := s.Jobs.CreateJob(model.JobTypeElasticsearchFixChannelIndex, nil); appErr != nil {
|
||||
mlog.Fatal("failed to start job for fixing Elasticsearch channels index", mlog.Err(appErr))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) DoAppMigrations() {
|
||||
a.Srv().doAppMigrations()
|
||||
}
|
||||
@@ -580,4 +598,5 @@ func (s *Server) doAppMigrations() {
|
||||
s.doFirstAdminSetupCompleteMigration()
|
||||
s.doRemainingSchemaMigrations()
|
||||
s.doPostPriorityConfigDefaultTrueMigration()
|
||||
s.doElasticsearchFixChannelIndex()
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user