Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcbridge: Increase polling interval for VFS cache cleaner #88

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions rcbridge/rcbridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,15 @@ func getVfs(remote string) (*vfs.VFS, error) {
opts.CacheMode = vfscommon.CacheModeOff
}

// Don't let the cache grow too big.
opts.CacheMaxAge = fs.Duration(60 * time.Second)
// Clean up cached files as soon as possible. The background upload
// monitor service will stop as soon as all files are closed and Android
// will SIGSTOP the process soon after that. The default poll interval
// generally causes files to not be cleaned up until the next time the
// user actively interacts with RSAF. If RSAF gets restarted in the
// meantime, the cleanup won't even run until the next time the VFS is
// created for this specific remote.
opts.CacheMaxAge = fs.Duration(15 * time.Second)
opts.CachePollInterval = fs.Duration(20 * time.Second)

// Adjust read buffering to be more appropriate for a mobile app.
// Maybe make this configurable in the future.
Expand Down
Loading