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:
Diffstat (limited to 'internal/serving/disk/zip/serving.go')
-rw-r--r--internal/serving/disk/zip/serving.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/serving/disk/zip/serving.go b/internal/serving/disk/zip/serving.go
index 95894fc9..9b3a7aa7 100644
--- a/internal/serving/disk/zip/serving.go
+++ b/internal/serving/disk/zip/serving.go
@@ -1,16 +1,21 @@
package zip
import (
+ "gitlab.com/gitlab-org/gitlab-pages/internal/config"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs/zip"
)
-var instance = disk.New(vfs.Instrumented(zip.New()))
+var instance serving.Serving
// Instance returns a serving instance that is capable of reading files
// from a zip archives opened from a URL, most likely stored in object storage
func Instance() serving.Serving {
+ if instance == nil {
+ instance = disk.New(vfs.Instrumented(zip.New(config.ZipVFSConfig)))
+ }
+
return instance
}