From 24ced8fdb459c4aaa212560d17de44a2d3ac0007 Mon Sep 17 00:00:00 2001 From: samwaf Date: Wed, 24 May 2023 14:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8F=AF=E8=83=BD=E6=98=AF?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=20=E5=AF=BC=E8=87=B4=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wafenginecore/dequeengine.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/wafenginecore/dequeengine.go b/wafenginecore/dequeengine.go index b63ced6..28f2231 100644 --- a/wafenginecore/dequeengine.go +++ b/wafenginecore/dequeengine.go @@ -5,6 +5,7 @@ import ( "SamWaf/innerbean" "SamWaf/model" "SamWaf/utils" + "SamWaf/utils/zlog" "encoding/json" "github.com/edwingeng/deque" uuid "github.com/satori/go.uuid" @@ -27,16 +28,24 @@ func InitDequeEngine() { */ func ProcessDequeEngine() { for { + defer func() { + e := recover() + if e != nil { + zlog.Error("ProcessErrorException", e) + } + }() for !global.GQEQUE_DB.Empty() { weblogbean := global.GQEQUE_DB.PopFront() - global.GWAF_LOCAL_DB.Create(weblogbean) - //zlog.Info("DB", weblogbean) + if weblogbean != nil { + global.GWAF_LOCAL_DB.Create(weblogbean) + } } for !global.GQEQUE_LOG_DB.Empty() { weblogbean := global.GQEQUE_LOG_DB.PopFront() - global.GWAF_LOCAL_LOG_DB.Create(weblogbean) - //zlog.Info("LOGDB", weblogbean) + if weblogbean != nil { + global.GWAF_LOCAL_LOG_DB.Create(weblogbean) + } } for !global.GQEQUE_MESSAGE_DB.Empty() {