chore: clear parent folder cache after upload

refactor/fs
Noah Hsu 2022-06-24 14:24:39 +08:00
parent 3f49271db6
commit 935416de45
1 changed files with 7 additions and 1 deletions

View File

@ -214,5 +214,11 @@ func Put(ctx context.Context, account driver.Driver, dstDirPath string, file mod
if up == nil {
up = func(p int) {}
}
return account.Put(ctx, parentDir, file, up)
err = account.Put(ctx, parentDir, file, up)
if err == nil {
// clear cache
key := stdpath.Join(account.GetAccount().VirtualPath, dstDirPath)
filesCache.Del(key)
}
return err
}