fix: do not operate storage in memory if disabled

pull/1604/head
Noah Hsu 2022-08-11 21:46:03 +08:00
parent 0fdfd1f2c2
commit 0f853c86da
1 changed files with 3 additions and 0 deletions

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