From 2ecf7093233ce9ffe48808d75c2dddc481d29776 Mon Sep 17 00:00:00 2001 From: Britt Gresham Date: Thu, 12 Dec 2024 12:15:18 -0800 Subject: [PATCH] Catch ambiguous state definitions --- pkg/service/service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/service/service.go b/pkg/service/service.go index dcaa968..1b2e05b 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -210,6 +210,9 @@ func New(config *config.Config) ShrlsService { log.Fatal("State backend is undefined") } var state server.ServerState + if config.StateBackend.Bolt != nil && config.StateBackend.Mongo != nil { + log.Fatal("Ambiguous state backend defined. Please use a single state backend.") + } if config.StateBackend.Bolt != nil { state = boltstate.New(*config) s.SetState(state)