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:
authorKamil Trzciński <ayufan@ayufan.eu>2020-10-01 11:49:59 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2020-10-01 11:49:59 +0300
commit98168fa262eb166223306ac6a6e4e0ceb1073c8c (patch)
tree725d0f1347d8c5fa83465dbad1fb9e65dfc9f6b5
parent0e0c86e51ab7597dd357466513141061384ef69b (diff)
Move ZipCachedArchives closer
-rw-r--r--internal/vfs/zip/archive.go1
-rw-r--r--internal/vfs/zip/vfs.go2
2 files changed, 2 insertions, 1 deletions
diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go
index 6ce6d319..5fc55b0d 100644
--- a/internal/vfs/zip/archive.go
+++ b/internal/vfs/zip/archive.go
@@ -224,6 +224,5 @@ func (a *zipArchive) Readlink(ctx context.Context, name string) (string, error)
// onEvicted called by the zipVFS.cache when an archive is removed from the cache
func (a *zipArchive) onEvicted() {
- metrics.ZipCachedArchives.Dec()
metrics.ZipArchiveEntriesCached.Sub(float64(len(a.files)))
}
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go
index 4c9270ac..fd0855f7 100644
--- a/internal/vfs/zip/vfs.go
+++ b/internal/vfs/zip/vfs.go
@@ -36,6 +36,8 @@ func New() vfs.VFS {
}
zipVFS.cache.OnEvicted(func(s string, i interface{}) {
+ metrics.ZipCachedArchives.Dec()
+
i.(*zipArchive).onEvicted()
})