Make used of typed atomic.Pointer (#23550)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2ac375b3fe
Коммит
7a9a098ce4
@@ -21,7 +21,7 @@ type SearchStore struct {
|
||||
channel *SearchChannelStore
|
||||
post *SearchPostStore
|
||||
fileInfo *SearchFileInfoStore
|
||||
configValue atomic.Value
|
||||
configValue atomic.Pointer[model.Config]
|
||||
}
|
||||
|
||||
func NewSearchLayer(baseStore store.Store, searchEngine *searchengine.Broker, cfg *model.Config) *SearchStore {
|
||||
@@ -44,7 +44,7 @@ func (s *SearchStore) UpdateConfig(cfg *model.Config) {
|
||||
}
|
||||
|
||||
func (s *SearchStore) getConfig() *model.Config {
|
||||
return s.configValue.Load().(*model.Config)
|
||||
return s.configValue.Load()
|
||||
}
|
||||
|
||||
func (s *SearchStore) Channel() store.ChannelStore {
|
||||
|
||||
Ссылка в новой задаче
Block a user