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:
authorJaime Martinez <jmartinez@gitlab.com>2020-11-30 14:35:06 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-11-30 14:37:23 +0300
commitd13acbb585182980c0fcdba72df26001fafbce38 (patch)
treecd8650cb0e69fe633beb91ff6dbb2be114df38f5 /internal/serving/disk/zip
parent14e61effff77b6dde9effc665a13c82bec509067 (diff)
Remove default config
Add todo to reconfigure other vfs
Diffstat (limited to 'internal/serving/disk/zip')
-rw-r--r--internal/serving/disk/zip/serving.go2
-rw-r--r--internal/serving/disk/zip/serving_test.go15
2 files changed, 10 insertions, 7 deletions
diff --git a/internal/serving/disk/zip/serving.go b/internal/serving/disk/zip/serving.go
index 6d21f771..6db0be10 100644
--- a/internal/serving/disk/zip/serving.go
+++ b/internal/serving/disk/zip/serving.go
@@ -8,7 +8,7 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs/zip"
)
-var instance = disk.New(vfs.Instrumented(zip.New(config.Default.Zip)))
+var instance = disk.New(vfs.Instrumented(zip.New(&config.ZipServing{})))
// 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
diff --git a/internal/serving/disk/zip/serving_test.go b/internal/serving/disk/zip/serving_test.go
index 40b8e02a..e64a761a 100644
--- a/internal/serving/disk/zip/serving_test.go
+++ b/internal/serving/disk/zip/serving_test.go
@@ -55,14 +55,17 @@ func TestZip_ServeFileHTTP(t *testing.T) {
},
}
- config.Default.Zip = &config.ZipServing{
- ExpirationInterval: 10 * time.Second,
- CleanupInterval: 5 * time.Second,
- RefreshInterval: 5 * time.Second,
- OpenTimeout: 5 * time.Second,
+ cfg := &config.Config{
+ Zip: &config.ZipServing{
+ ExpirationInterval: 10 * time.Second,
+ CleanupInterval: 5 * time.Second,
+ RefreshInterval: 5 * time.Second,
+ OpenTimeout: 5 * time.Second,
+ },
}
+
s := Instance()
- err := s.Reconfigure(config.Default)
+ err := s.Reconfigure(cfg)
require.NoError(t, err)
for name, test := range tests {