1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

vfs: implement --vfs-cache-max-size to limit the total size of the cache

This commit is contained in:
Nick Craig-Wood
2019-02-01 23:35:03 +00:00
parent fffdbb31f5
commit a43ed567ee
5 changed files with 367 additions and 105 deletions

View File

@@ -50,6 +50,7 @@ var DefaultOpt = Options{
CachePollInterval: 60 * time.Second,
ChunkSize: 128 * fs.MebiByte,
ChunkSizeLimit: -1,
CacheMaxSize: -1,
}
// Node represents either a directory (*Dir) or a file (*File)
@@ -196,6 +197,7 @@ type Options struct {
ChunkSizeLimit fs.SizeSuffix // if > ChunkSize double the chunk size after each chunk until reached
CacheMode CacheMode
CacheMaxAge time.Duration
CacheMaxSize fs.SizeSuffix
CachePollInterval time.Duration
}