mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-30 05:31:26 +08:00
[fix] 规则链解析失败
This commit is contained in:
@@ -22,12 +22,14 @@ func GetDebugDataPage(page, pageSize int, ruleId, nodeId string) (int64, []messa
|
||||
}
|
||||
offset := pageSize * (page - 1)
|
||||
if data, ok := ruleChainDebugData.Data[ruleId]; ok {
|
||||
total := len(data.Get(nodeId).Items)
|
||||
end := offset + pageSize
|
||||
if end >= total {
|
||||
end = total - 1
|
||||
if data.Get(nodeId) != nil {
|
||||
total := len(data.Get(nodeId).Items)
|
||||
end := offset + pageSize
|
||||
if end >= total {
|
||||
end = total - 1
|
||||
}
|
||||
return int64(total), data.Get(nodeId).Items[offset:end]
|
||||
}
|
||||
return int64(total), data.Get(nodeId).Items[offset:end]
|
||||
}
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ func (d *NodeDebugData) Clear(nodeId string) {
|
||||
// DebugData 调试数据
|
||||
// OnDebug 回调函数提供的数据
|
||||
type DebugData struct {
|
||||
Ts string
|
||||
Ts string `json:"ts"`
|
||||
NodeId string `json:"nodeId"`
|
||||
MsgId string `json:"msgId"`
|
||||
DebugType string `json:"debugType"` // In or Out
|
||||
|
||||
Reference in New Issue
Block a user