From 0f853c86dae59d6fbe83182a153dd94cc22efc6f Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Thu, 11 Aug 2022 21:46:03 +0800 Subject: [PATCH] fix: do not operate storage in memory if disabled --- internal/operations/storage.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/operations/storage.go b/internal/operations/storage.go index 35092c9c..a83fa6e0 100644 --- a/internal/operations/storage.go +++ b/internal/operations/storage.go @@ -143,6 +143,9 @@ func UpdateStorage(ctx context.Context, storage model.Storage) error { if err != nil { return errors.WithMessage(err, "failed update storage in database") } + if storage.Disabled { + return nil + } storageDriver, err := GetStorageByVirtualPath(oldStorage.MountPath) if oldStorage.MountPath != storage.MountPath { // virtual path renamed, need to drop the storage