fix: do not operate storage in memory if disabled

This commit is contained in:
Noah Hsu 2022-08-11 21:46:03 +08:00
parent 0fdfd1f2c2
commit 0f853c86da

View File

@ -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