Add vfs cache poll interval
This commit is contained in:
@@ -99,6 +99,7 @@ type Rclone struct {
|
|||||||
VfsReadChunkSize string `json:"vfs_read_chunk_size,omitempty"` // Read chunk size (default 128M)
|
VfsReadChunkSize string `json:"vfs_read_chunk_size,omitempty"` // Read chunk size (default 128M)
|
||||||
VfsReadChunkSizeLimit string `json:"vfs_read_chunk_size_limit,omitempty"` // Max chunk size (default off)
|
VfsReadChunkSizeLimit string `json:"vfs_read_chunk_size_limit,omitempty"` // Max chunk size (default off)
|
||||||
VfsReadAhead string `json:"vfs_read_ahead,omitempty"` // read ahead size
|
VfsReadAhead string `json:"vfs_read_ahead,omitempty"` // read ahead size
|
||||||
|
VfsPollInterval string `json:"vfs_poll_interval,omitempty"` // How often to rclone cleans the cache (default 1m)
|
||||||
BufferSize string `json:"buffer_size,omitempty"` // Buffer size for reading files (default 16M)
|
BufferSize string `json:"buffer_size,omitempty"` // Buffer size for reading files (default 16M)
|
||||||
|
|
||||||
// File system settings
|
// File system settings
|
||||||
@@ -415,6 +416,7 @@ func (c *Config) setDefaults() {
|
|||||||
if c.Rclone.VfsCacheMode != "off" {
|
if c.Rclone.VfsCacheMode != "off" {
|
||||||
c.Rclone.VfsCachePollInterval = cmp.Or(c.Rclone.VfsCachePollInterval, "1m")
|
c.Rclone.VfsCachePollInterval = cmp.Or(c.Rclone.VfsCachePollInterval, "1m")
|
||||||
c.Rclone.VfsReadChunkSizeLimit = cmp.Or(c.Rclone.VfsReadChunkSizeLimit, "off")
|
c.Rclone.VfsReadChunkSizeLimit = cmp.Or(c.Rclone.VfsReadChunkSizeLimit, "off")
|
||||||
|
c.Rclone.VfsCachePollInterval = cmp.Or(c.Rclone.VfsCachePollInterval, "1m") // Clean cache every minute
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Rclone.AttrTimeout = cmp.Or(c.Rclone.AttrTimeout, "10s")
|
c.Rclone.AttrTimeout = cmp.Or(c.Rclone.AttrTimeout, "10s")
|
||||||
|
|||||||
+6
-1
@@ -170,7 +170,6 @@ func (m *Mount) performMount(ctx context.Context, mountfn mountlib.MountFn) erro
|
|||||||
vfsOpt := &vfscommon.Options{
|
vfsOpt := &vfscommon.Options{
|
||||||
NoModTime: rcloneOpt.NoModTime,
|
NoModTime: rcloneOpt.NoModTime,
|
||||||
NoChecksum: rcloneOpt.NoChecksum,
|
NoChecksum: rcloneOpt.NoChecksum,
|
||||||
PollInterval: 0, // Polling is disabled for webdav
|
|
||||||
CacheMode: cacheMode,
|
CacheMode: cacheMode,
|
||||||
UID: rcloneOpt.UID,
|
UID: rcloneOpt.UID,
|
||||||
GID: rcloneOpt.GID,
|
GID: rcloneOpt.GID,
|
||||||
@@ -183,6 +182,12 @@ func (m *Mount) performMount(ctx context.Context, mountfn mountlib.MountFn) erro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rcloneOpt.VfsCachePollInterval != "" {
|
||||||
|
if vfsCachePollInterval, err := time.ParseDuration(rcloneOpt.VfsCachePollInterval); err == nil {
|
||||||
|
vfsOpt.CachePollInterval = fs.Duration(vfsCachePollInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if rcloneOpt.VfsCacheMaxAge != "" {
|
if rcloneOpt.VfsCacheMaxAge != "" {
|
||||||
if vfsCacheMaxAge, err := time.ParseDuration(rcloneOpt.VfsCacheMaxAge); err == nil {
|
if vfsCacheMaxAge, err := time.ParseDuration(rcloneOpt.VfsCacheMaxAge); err == nil {
|
||||||
vfsOpt.CacheMaxAge = fs.Duration(vfsCacheMaxAge)
|
vfsOpt.CacheMaxAge = fs.Duration(vfsCacheMaxAge)
|
||||||
|
|||||||
@@ -470,7 +470,7 @@
|
|||||||
|
|
||||||
<div class="form-control">
|
<div class="form-control">
|
||||||
<label class="label" for="rclone.vfs_read_ahead">
|
<label class="label" for="rclone.vfs_read_ahead">
|
||||||
<span class="label-text font-medium">Read Ahead</span>
|
<span class="label-text font-medium">VFS Read Ahead</span>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" class="input input-bordered" name="rclone.vfs_read_ahead" id="rclone.vfs_read_ahead" placeholder="128k">
|
<input type="text" class="input input-bordered" name="rclone.vfs_read_ahead" id="rclone.vfs_read_ahead" placeholder="128k">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
@@ -488,6 +488,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-control">
|
||||||
|
<label class="label" for="rclone.vfs_cache_poll_interval">
|
||||||
|
<span class="label-text font-medium">VFS Cache Poll Interval</span>
|
||||||
|
</label>
|
||||||
|
<input type="text" class="input input-bordered" name="rclone.vfs_cache_poll_interval" id="rclone.vfs_cache_poll_interval" placeholder="1h">
|
||||||
|
<div class="label">
|
||||||
|
<span class="label-text-alt">How often VFS cache dir gets cleaned</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user