From 57195a5ae472878c19dae4b6a65bc37a76e992e4 Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Sat, 25 Jun 2022 22:09:09 +0200 Subject: Open files lazily when serving content Changelog: performance --- internal/vfs/root.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/vfs/root.go') diff --git a/internal/vfs/root.go b/internal/vfs/root.go index 9c7528b3..1a2e9ccd 100644 --- a/internal/vfs/root.go +++ b/internal/vfs/root.go @@ -16,6 +16,7 @@ type Root interface { Lstat(ctx context.Context, name string) (os.FileInfo, error) Readlink(ctx context.Context, name string) (string, error) Open(ctx context.Context, name string) (File, error) + IsCompressed(name string) (bool, error) } type instrumentedRoot struct { @@ -68,3 +69,7 @@ func (i *instrumentedRoot) Open(ctx context.Context, name string) (File, error) return f, err } + +func (i *instrumentedRoot) IsCompressed(name string) (bool, error) { + return i.root.IsCompressed(name) +} -- cgit v1.2.3