This commit is contained in:
shoopea 2019-05-08 18:47:32 +08:00
parent fc4d8c0ff4
commit b37ca8547b

4
sql.go
View File

@ -3,6 +3,7 @@ package main
import ( import (
"errors" "errors"
"log" "log"
"regexp"
"strconv" "strconv"
) )
@ -287,6 +288,8 @@ func loadMsgParsingRules() (map[int]MessageParsingRule, error) {
msgTypeID int32 msgTypeID int32
) )
log.Println("Loading message parsing rules...")
m := make(map[int]MessageParsingRule) m := make(map[int]MessageParsingRule)
count := int(0) count := int(0)
@ -307,6 +310,7 @@ func loadMsgParsingRules() (map[int]MessageParsingRule, error) {
i.Description = descn i.Description = descn
i.Rule = rule i.Rule = rule
i.MsgTypeID = msgTypeID i.MsgTypeID = msgTypeID
i.re = regexp.MustCompile(rule)
m[count] = *i m[count] = *i
count++ count++