From d0ebfd76acb12e586f3c779298a3354924bcb7b4 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 7 Nov 2024 18:44:25 +0800 Subject: [PATCH] 1 --- library/middleware/notif_sender.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/library/middleware/notif_sender.go b/library/middleware/notif_sender.go index 8e3232fa..78282fd7 100644 --- a/library/middleware/notif_sender.go +++ b/library/middleware/notif_sender.go @@ -27,7 +27,7 @@ func InitNotifSender(_DefaultNotification *logic.Notification, _DefaultNotifBcst // 获取通知builder notifBuildersObj, ok := ctx.Get("notif_builders") if !ok { - ctx.Next() + return } notifBuilders := notifBuildersObj.([]*dbstruct.NotifBuilder) @@ -92,14 +92,16 @@ func InitNotifSender(_DefaultNotification *logic.Notification, _DefaultNotifBcst }) if err != nil { logger.Error("通知创建失败:%v", err) - ctx.Next() + continue } // 将通知id暂存,若暂存失败,则不广播该条通知,因业务无法再控制其停止 - err = notifBuilder.NidSaveFunc(ctx, notification.GetId()) - if err != nil { - logger.Error("通知id暂存失败:%v", err) - continue + if notifBuilder.NidSaveFunc != nil { + err = notifBuilder.NidSaveFunc(ctx, notification.GetId()) + if err != nil { + logger.Error("通知id暂存失败:%v", err) + continue + } } nids := make([]int64, 0)