From acbcbf455f886e0b0a7b15382ec3334efc704ee1 Mon Sep 17 00:00:00 2001 From: xing Date: Tue, 24 Oct 2023 16:06:59 +0800 Subject: [PATCH] improve --- app/cmd/reload/reload.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/cmd/reload/reload.go b/app/cmd/reload/reload.go index 74c78dc..84bbbaf 100644 --- a/app/cmd/reload/reload.go +++ b/app/cmd/reload/reload.go @@ -45,12 +45,14 @@ func FlushMapVal[T any](namespace string, key T) { fn(key) } -func FlushAnyVal(namespace string) { - fn, ok := callsM.Load(namespace) - if !ok { - return +func FlushAnyVal(namespaces ...string) { + for _, namespace := range namespaces { + fn, ok := callsM.Load(namespace) + if !ok { + return + } + fn() } - fn() } func GetAnyMapFnBys[K comparable, V, A any](namespace string, fn func(A) V) func(key K, args A) V {