[MM-23535] Add disable database search flag and return empty posts results if set (#14245)
* [MM-23535] Add disable database search flag and return empty posts results if set * Add UpdateConfig function for the SearchStore and hook it into the app lifecycle * Add the config listener in the server instance instead of using FakeApp * Instantiate searchlayer as a pointer to avoid passing around copies of it
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
288ed40e8f
Коммит
4fde004a5b
@@ -62,16 +62,23 @@ func (s *Server) RunOldAppInitialization() error {
|
||||
if s.newStore == nil {
|
||||
s.newStore = func() store.Store {
|
||||
s.sqlStore = sqlstore.NewSqlSupplier(s.Config().SqlSettings, s.Metrics)
|
||||
return store.NewTimerLayer(
|
||||
searchlayer.NewSearchLayer(
|
||||
localcachelayer.NewLocalCacheLayer(
|
||||
s.sqlStore,
|
||||
s.Metrics,
|
||||
s.Cluster,
|
||||
s.CacheProvider,
|
||||
),
|
||||
s.SearchEngine,
|
||||
searchStore := searchlayer.NewSearchLayer(
|
||||
localcachelayer.NewLocalCacheLayer(
|
||||
s.sqlStore,
|
||||
s.Metrics,
|
||||
s.Cluster,
|
||||
s.CacheProvider,
|
||||
),
|
||||
s.SearchEngine,
|
||||
s.Config(),
|
||||
)
|
||||
|
||||
s.AddConfigListener(func(prevCfg, cfg *model.Config) {
|
||||
searchStore.UpdateConfig(cfg)
|
||||
})
|
||||
|
||||
return store.NewTimerLayer(
|
||||
searchStore,
|
||||
s.Metrics,
|
||||
)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user