1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-02 15:16:51 +02:00

filer: report error if the path specific store is not found

related https://github.com/chrislusf/seaweedfs/issues/1691
This commit is contained in:
Chris Lu 2020-12-21 12:43:52 -08:00
parent f30de7f827
commit f5a19a87be

View file

@ -59,7 +59,11 @@ func (f *Filer) LoadConfiguration(config *viper.Viper) {
parts := strings.Split(key, ".")
storeName, storeId := parts[0], parts[1]
store := storeNames[storeName]
store, found := storeNames[storeName]
if !found {
glog.Errorf("path-specific filer store %s.%s is not found", storeName, storeId)
os.Exit(-1)
}
store = reflect.New(reflect.ValueOf(store).Elem().Type()).Interface().(FilerStore)
if err := store.Initialize(config, key+"."); err != nil {
glog.Fatalf("Failed to initialize store for %s: %+v", key, err)