Skip to content

Commit ffbbe7a

Browse files
committed
fix(storage): clear list cache after storage updates
1 parent 527ad89 commit ffbbe7a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/op/storage.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,13 @@ func UpdateStorage(ctx context.Context, storage model.Storage) error {
229229
if err != nil {
230230
return errors.WithMessage(err, "failed update storage in database")
231231
}
232+
storageDriver, err := GetStorageByMountPath(oldStorage.MountPath)
233+
if err == nil {
234+
ClearCache(storageDriver, "/")
235+
}
232236
if storage.Disabled {
233237
return nil
234238
}
235-
storageDriver, err := GetStorageByMountPath(oldStorage.MountPath)
236239
if oldStorage.MountPath != storage.MountPath {
237240
// mount path renamed, need to drop the storage
238241
storagesMap.Delete(oldStorage.MountPath)

0 commit comments

Comments
 (0)