mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs/cache: add --fs-cache-expire-duration to control the fs cache
This commit makes the previously statically configured fs cache configurable. It introduces two parameters `--fs-cache-expire-duration` and `--fs-cache-expire-interval` to control the caching of the items. It also adds new interfaces to lib/cache to set these.
This commit is contained in:
@@ -123,6 +123,8 @@ type ConfigInfo struct {
|
||||
RefreshTimes bool
|
||||
NoConsole bool
|
||||
TrafficClass uint8
|
||||
FsCacheExpireDuration time.Duration
|
||||
FsCacheExpireInterval time.Duration
|
||||
}
|
||||
|
||||
// NewConfig creates a new config with everything set to the default
|
||||
@@ -160,6 +162,8 @@ func NewConfig() *ConfigInfo {
|
||||
c.MultiThreadStreams = 4
|
||||
|
||||
c.TrackRenamesStrategy = "hash"
|
||||
c.FsCacheExpireDuration = 300 * time.Second
|
||||
c.FsCacheExpireInterval = 60 * time.Second
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user