mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-52943] fix: enable Elasticsearch properly on restart (#23806)
* fix: enable elasticsearch properly on restart * use correct method under IsEnabled * Empty-Commit to retrigger workflow --------- Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com> Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
9bc22b633f
commit
cad2df1259
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func (ps *PlatformService) StartSearchEngine() (string, string) {
|
||||
if ps.SearchEngine.ElasticsearchEngine != nil && ps.SearchEngine.ElasticsearchEngine.IsActive() {
|
||||
if ps.SearchEngine.ElasticsearchEngine != nil && ps.SearchEngine.ElasticsearchEngine.IsEnabled() {
|
||||
ps.Go(func() {
|
||||
if err := ps.SearchEngine.ElasticsearchEngine.Start(); err != nil {
|
||||
ps.Log().Error(err.Error())
|
||||
|
@ -219,6 +219,10 @@ func (b *BleveEngine) Stop() *model.AppError {
|
||||
return b.closeIndexes()
|
||||
}
|
||||
|
||||
func (b *BleveEngine) IsEnabled() bool {
|
||||
return b.IsIndexingEnabled()
|
||||
}
|
||||
|
||||
func (b *BleveEngine) IsActive() bool {
|
||||
return atomic.LoadInt32(&b.ready) == 1
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ type SearchEngineInterface interface {
|
||||
GetPlugins() []string
|
||||
UpdateConfig(cfg *model.Config)
|
||||
GetName() string
|
||||
// IsEnabled returns a boolean indicating whether the engine is enabled in the settings
|
||||
IsEnabled() bool
|
||||
IsActive() bool
|
||||
IsIndexingEnabled() bool
|
||||
IsSearchEnabled() bool
|
||||
|
@ -326,6 +326,20 @@ func (_m *SearchEngineInterface) IsAutocompletionEnabled() bool {
|
||||
return r0
|
||||
}
|
||||
|
||||
// IsEnabled provides a mock function with given fields:
|
||||
func (_m *SearchEngineInterface) IsEnabled() bool {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 bool
|
||||
if rf, ok := ret.Get(0).(func() bool); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// IsIndexingEnabled provides a mock function with given fields:
|
||||
func (_m *SearchEngineInterface) IsIndexingEnabled() bool {
|
||||
ret := _m.Called()
|
||||
|
Loading…
Reference in New Issue
Block a user