From 1d6eec3291a607818d5c9df0472c4c7e03e36f16 Mon Sep 17 00:00:00 2001 From: blek Date: Thu, 16 Nov 2023 19:03:51 +1000 Subject: [PATCH] print warning in resourceD if no resources are specified and report number of resources on startup --- resource/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resource/main.go b/resource/main.go index a63adde..67031fe 100644 --- a/resource/main.go +++ b/resource/main.go @@ -87,6 +87,12 @@ func main() { conf.Validate() + if len(conf.Resource) == 0 { + fmt.Println("\x1b[33m[warn] No resources are specified\x1b[0m"); + } else { + fmt.Println(fmt.Sprintf("[info] Loaded %d resources", len(conf.Resource))) + } + if ! conf.ResourceD.Enabled { fmt.Println("\x1b[33m[warn] resourceD is disabled. No resources will be served\x1b[0m") }