Skip to content

Commit

Permalink
chore: clear parent folder cache after upload
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 24, 2022
1 parent 3f49271 commit 935416d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/operations/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 935416d

Please sign in to comment.