Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-07-26 18:30:26 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-11-08 18:24:14 +0300
commit77a733b8af393f81c1143ca27324384b1801a090 (patch)
treec4e17cbfedb872806b3b3c73959806a79d3e3a93 /internal/vfs/vfs.go
parent81e6fdba4fa75b3e882cde818c25a2a76f531de7 (diff)
refactor: read and use file_sha256 as cache key for zip VFS
Now that the Rails API is serving the archive file_sha256 in the lookup response, we can move away from using the base URL as the key to cache the archive. Changelog: change
Diffstat (limited to 'internal/vfs/vfs.go')
-rw-r--r--internal/vfs/vfs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/vfs/vfs.go b/internal/vfs/vfs.go
index 40fe8bc7..a93f9e26 100644
--- a/internal/vfs/vfs.go
+++ b/internal/vfs/vfs.go
@@ -13,7 +13,7 @@ import (
// VFS abstracts the things Pages needs to serve a static site from disk.
type VFS interface {
- Root(ctx context.Context, path string) (Root, error)
+ Root(ctx context.Context, path string, cacheKey string) (Root, error)
Name() string
Reconfigure(config *config.Config) error
}
@@ -34,8 +34,8 @@ func (i *instrumentedVFS) log(ctx context.Context) *logrus.Entry {
return log.ContextLogger(ctx).WithField("vfs", i.fs.Name())
}
-func (i *instrumentedVFS) Root(ctx context.Context, path string) (Root, error) {
- root, err := i.fs.Root(ctx, path)
+func (i *instrumentedVFS) Root(ctx context.Context, path string, cacheKey string) (Root, error) {
+ root, err := i.fs.Root(ctx, path, cacheKey)
i.increment("Root", err)
i.log(ctx).