diff options
Diffstat (limited to 'internal/serving')
-rw-r--r-- | internal/serving/disk/zip/serving.go | 15 | ||||
-rw-r--r-- | internal/serving/disk/zip/serving_test.go | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/internal/serving/disk/zip/serving.go b/internal/serving/disk/zip/serving.go index b31d9090..6d21f771 100644 --- a/internal/serving/disk/zip/serving.go +++ b/internal/serving/disk/zip/serving.go @@ -1,10 +1,6 @@ package zip import ( - "sync" - - "gitlab.com/gitlab-org/labkit/log" - "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" @@ -12,19 +8,10 @@ import ( "gitlab.com/gitlab-org/gitlab-pages/internal/vfs/zip" ) -var ( - once sync.Once - instance = disk.New(vfs.Instrumented(zip.New(config.Default.Zip))) -) +var instance = disk.New(vfs.Instrumented(zip.New(config.Default.Zip))) // 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 { - once.Do(func() { - if err := instance.Reconfigure(config.Default); err != nil { - log.WithError(err).Fatal("failed to reconfigure zip serving") - } - }) - return instance } diff --git a/internal/serving/disk/zip/serving_test.go b/internal/serving/disk/zip/serving_test.go index 5bf16d7b..40b8e02a 100644 --- a/internal/serving/disk/zip/serving_test.go +++ b/internal/serving/disk/zip/serving_test.go @@ -62,6 +62,8 @@ func TestZip_ServeFileHTTP(t *testing.T) { OpenTimeout: 5 * time.Second, } s := Instance() + err := s.Reconfigure(config.Default) + require.NoError(t, err) for name, test := range tests { t.Run(name, func(t *testing.T) { |