This commit is contained in:
shoopea 2019-05-08 18:17:07 +08:00
parent 5fdb6747e9
commit 4bf93ca991
2 changed files with 9 additions and 8 deletions

16
sql.go
View File

@ -297,17 +297,17 @@ func loadMsgParsingRules() (map[int]MessageParsingRule, error) {
defer rules.Close() defer rules.Close()
for rules.Next() { for rules.Next() {
err = classifs.Scan(&id, &priority, &descn, &rule, &msgTypeID) err = rules.Scan(&id, &priority, &descn, &rule, &msgTypeID)
if err != nil { if err != nil {
return m, err return m, err
} }
rule := new(MessageParsingRule) i := new(MessageParsingRule)
rule.ID = id i.ID = id
rule.Priority = priority i.Priority = priority
rule.Description = descn i.Description = descn
rule.Rule = rule i.Rule = rule
rule.MsgTypeID = msgTypeID i.MsgTypeID = msgTypeID
m[count] = *rule m[count] = *i
count++ count++
} }

View File

@ -5,6 +5,7 @@ import (
"log" "log"
"regexp" "regexp"
"strconv" "strconv"
"time"
"github.com/streadway/amqp" "github.com/streadway/amqp"
) )