[MM-35470] Disable config watching logic (#17913)

* Disable config watching logic

* Fix tests
Этот коммит содержится в:
Claudio Costa
2021-07-26 20:13:30 +02:00
коммит произвёл GitHub
родитель b01f8ab0c8
Коммит 186475db3b
21 изменённых файлов: 82 добавлений и 313 удалений

Просмотреть файл

@@ -61,8 +61,6 @@ type BackingStore interface {
// String describes the backing store for the config.
String() string
Watch(callback func()) error
// Close cleans up resources associated with the store.
Close() error
}
@@ -80,24 +78,18 @@ func NewStoreFromBacking(backingStore BackingStore, customDefaults *model.Config
return nil, errors.Wrap(err, "unable to load on store creation")
}
if err := backingStore.Watch(func() {
store.Load()
}); err != nil {
return nil, errors.Wrap(err, "failed to watch backing store")
}
return store, nil
}
// NewStoreFromDSN creates and returns a new config store backed by either a database or file store
// depending on the value of the given data source name string.
func NewStoreFromDSN(dsn string, watch, readOnly bool, customDefaults *model.Config) (*Store, error) {
func NewStoreFromDSN(dsn string, readOnly bool, customDefaults *model.Config) (*Store, error) {
var err error
var backingStore BackingStore
if IsDatabaseDSN(dsn) {
backingStore, err = NewDatabaseStore(dsn)
} else {
backingStore, err = NewFileStore(dsn, watch)
backingStore, err = NewFileStore(dsn)
}
if err != nil {
return nil, err