mirror of
https://github.com/rclone/rclone.git
synced 2026-01-04 09:33:36 +00:00
hand dirCacheTime through again
This commit is contained in:
committed by
Nick Craig-Wood
parent
9cede6b372
commit
9782c264e9
@@ -35,11 +35,12 @@ var (
|
||||
|
||||
// FS represents the top level filing system
|
||||
type FS struct {
|
||||
f fs.Fs
|
||||
root *Dir
|
||||
noSeek bool // don't allow seeking if set
|
||||
noChecksum bool // don't check checksums if set
|
||||
readOnly bool // if set FS is read only
|
||||
f fs.Fs
|
||||
root *Dir
|
||||
noSeek bool // don't allow seeking if set
|
||||
noChecksum bool // don't check checksums if set
|
||||
readOnly bool // if set FS is read only
|
||||
dirCacheTime time.Duration // how long to consider directory listing cache valid
|
||||
}
|
||||
|
||||
// NewFS creates a new filing system and root directory
|
||||
@@ -57,6 +58,13 @@ func NewFS(f fs.Fs) *FS {
|
||||
return fsys
|
||||
}
|
||||
|
||||
// SetDirCacheTime allows to set how long a directory listing is considered
|
||||
// valid. Set to 0 always request a fresh version from the remote.
|
||||
func (fsys *FS) SetDirCacheTime(dirCacheTime time.Duration) *FS {
|
||||
fsys.dirCacheTime = dirCacheTime
|
||||
return fsys
|
||||
}
|
||||
|
||||
// PollChanges will poll the remote every pollInterval for changes if the remote
|
||||
// supports it. If a non-polling option is used, the given time interval can be
|
||||
// ignored
|
||||
|
||||
Reference in New Issue
Block a user