From 2af85409265d96ae724f8d3f1d20aaa6b3322783 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Mon, 27 Jan 2025 16:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8deepSeep=20V3=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B8=8B=E8=BF=9B=E8=A1=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/plate.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/plate.go b/modules/plate.go index 324f9b9..7090ebf 100644 --- a/modules/plate.go +++ b/modules/plate.go @@ -43,8 +43,9 @@ func LoadPlate(cr *core.Core, instId string) (*core.Plate, error) { if err == nil && str != "" { // 将JSON字符串反序列化为Plate对象 if err := json.Unmarshal([]byte(str), &pl); err != nil { - // 反序列化失败时返回错误 - return nil, fmt.Errorf("failed to unmarshal plate data: %v", err) + // 反序列化失败时初始化一个新的Plate + logrus.Warnf("failed to unmarshal plate data from redis, init new plate: %v", err) + pl.Init(instId) } // 返回从Redis加载的Plate对象 return &pl, nil