From 1aa991ae1f1a426424549c92060b204114c8b3c2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 11 May 2024 14:34:15 +0200 Subject: refactor: deduce index path automatically from config.DataPath --- internal/server/server.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'internal/server') diff --git a/internal/server/server.go b/internal/server/server.go index 0474e39..28b74b2 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -40,7 +40,6 @@ type Config struct { BaseURL cfg.URL `conf:"default:http://localhost:3000,short:b"` ConfigFile string `conf:"short:c"` LogLevel slog.Level `conf:"default:INFO"` - IndexPath string `conf:"default:data/index.bleve"` SentryDSN string } @@ -87,7 +86,7 @@ func New(runtimeConfig *Config) (*Server, error) { } slog.Debug("loading index") - index, err := search.Open(runtimeConfig.IndexPath) + index, err := search.Open(config.DataPath) slog.Debug("loaded index") if err != nil { log.Fatalf("could not open search index, error: %#v", err) -- cgit 1.4.1