fix:Only print panic function frame && feat: log.ZPanic (#2947)

* fix: log print panic

* Merge: main
This commit is contained in:
icey-yu
2024-12-12 11:59:15 +08:00
committed by GitHub
parent 120afdf6ae
commit 92ea52febf
7 changed files with 10 additions and 13 deletions
+1 -2
View File
@@ -17,7 +17,6 @@ package rpccache
import (
"context"
"encoding/json"
"github.com/openimsdk/tools/mw"
"github.com/openimsdk/tools/log"
"github.com/redis/go-redis/v9"
@@ -26,7 +25,7 @@ import (
func subscriberRedisDeleteCache(ctx context.Context, client redis.UniversalClient, channel string, del func(ctx context.Context, key ...string)) {
defer func() {
if r := recover(); r != nil {
mw.PanicStackToLog(ctx, r)
log.ZPanic(ctx, "subscriberRedisDeleteCache Panic", r)
}
}()
for message := range client.Subscribe(ctx, channel).Channel() {