From 24c4715ed381596c4c20f75863da787e17026514 Mon Sep 17 00:00:00 2001 From: Mariano Cortesi Date: Tue, 1 Oct 2024 20:05:19 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20don't=20allow=20to=20configure=20fallbac?= =?UTF-8?q?k=20or=20cache=20with=20nil=20Redis|S3=20ins=E2=80=A6=20(#155)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: don't allow to configure fallback or cache with nil Redis|S3 instances --- server/load_store.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/load_store.go b/server/load_store.go index 0c042b1b..e1268430 100644 --- a/server/load_store.go +++ b/server/load_store.go @@ -23,9 +23,15 @@ func populateTargets(targets []string, s3 store.PrecomputedKeyStore, redis *redi switch b { case store.RedisBackendType: + if redis == nil { + panic(fmt.Sprintf("Redis backend is not configured but specified in targets: %s", f)) + } stores[i] = redis case store.S3BackendType: + if s3 == nil { + panic(fmt.Sprintf("S3 backend is not configured but specified in targets: %s", f)) + } stores[i] = s3 case store.EigenDABackendType, store.MemoryBackendType: