diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-03-01 00:47:03 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-03-01 00:47:03 -0800 |
| commit | d680676d45e7d5447c241cfef47a5c665931fc85 (patch) | |
| tree | 9aafee1f2630e6b8175a57a3405b31985611ac60 /weed/storage/backend | |
| parent | 65fbc0575f8321d29ba60fa8248d6df8e8b5b6cb (diff) | |
| download | seaweedfs-d680676d45e7d5447c241cfef47a5c665931fc85.tar.xz seaweedfs-d680676d45e7d5447c241cfef47a5c665931fc85.zip | |
skip already loaded backends
Diffstat (limited to 'weed/storage/backend')
| -rw-r--r-- | weed/storage/backend/backend.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/storage/backend/backend.go b/weed/storage/backend/backend.go index b8b883be6..2dc61d02e 100644 --- a/weed/storage/backend/backend.go +++ b/weed/storage/backend/backend.go @@ -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) |
