mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
skip already loaded backends
This commit is contained in:
parent
65fbc0575f
commit
d680676d45
|
@ -58,6 +58,9 @@ func LoadConfiguration(config *util.ViperProxy) {
|
|||
if !config.GetBool(StorageBackendPrefix + "." + backendTypeName + "." + backendStorageId + ".enabled") {
|
||||
continue
|
||||
}
|
||||
if _, found := BackendStorages[backendTypeName+"."+backendStorageId]; found {
|
||||
continue
|
||||
}
|
||||
backendStorage, buildErr := backendStorageFactory.BuildStorage(config,
|
||||
StorageBackendPrefix+"."+backendTypeName+"."+backendStorageId+".", backendStorageId)
|
||||
if buildErr != nil {
|
||||
|
@ -81,6 +84,9 @@ func LoadFromPbStorageBackends(storageBackends []*master_pb.StorageBackend) {
|
|||
glog.Warningf("storage type %s not found", storageBackend.Type)
|
||||
continue
|
||||
}
|
||||
if _, found := BackendStorages[storageBackend.Type+"."+storageBackend.Id]; found {
|
||||
continue
|
||||
}
|
||||
backendStorage, buildErr := backendStorageFactory.BuildStorage(newProperties(storageBackend.Properties), "", storageBackend.Id)
|
||||
if buildErr != nil {
|
||||
glog.Fatalf("fail to create backend storage %s.%s", storageBackend.Type, storageBackend.Id)
|
||||
|
|
Loading…
Reference in a new issue