drive: actually cache results on statcache

Updates #11967

Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
Percy Wegmann
2024-05-02 19:12:52 -05:00
committed by Percy Wegmann
parent 406293682c
commit 2cf764e998
4 changed files with 39 additions and 24 deletions

View File

@ -27,6 +27,10 @@ const (
// NewFileSystemForLocal starts serving a filesystem for local clients.
// Inbound connections must be handed to HandleConn.
func NewFileSystemForLocal(logf logger.Logf) *FileSystemForLocal {
return newFileSystemForLocal(logf, &compositedav.StatCache{TTL: statCacheTTL})
}
func newFileSystemForLocal(logf logger.Logf, statCache *compositedav.StatCache) *FileSystemForLocal {
if logf == nil {
logf = log.Printf
}
@ -34,7 +38,7 @@ func NewFileSystemForLocal(logf logger.Logf) *FileSystemForLocal {
logf: logf,
h: &compositedav.Handler{
Logf: logf,
StatCache: &compositedav.StatCache{TTL: statCacheTTL},
StatCache: statCache,
},
listener: newConnListener(),
}