debug
This commit is contained in:
parent
6650f650ae
commit
eb954d56a6
5
rules.go
5
rules.go
@ -7,6 +7,7 @@ import (
|
|||||||
|
|
||||||
func resetMsgParsingRules() error {
|
func resetMsgParsingRules() error {
|
||||||
var rules, rules2 []MessageParsingRule
|
var rules, rules2 []MessageParsingRule
|
||||||
|
var count int64
|
||||||
|
|
||||||
b, err := Asset("data/msg_rules.json")
|
b, err := Asset("data/msg_rules.json")
|
||||||
logOnError(err, "resetMsgParsingRules : load data/msg_rules.json")
|
logOnError(err, "resetMsgParsingRules : load data/msg_rules.json")
|
||||||
@ -52,6 +53,7 @@ func resetMsgParsingRules() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer stmt.Close()
|
defer stmt.Close()
|
||||||
|
count = 0
|
||||||
for _, r2 := range rules2 {
|
for _, r2 := range rules2 {
|
||||||
|
|
||||||
_, err = stmt.Exec(r2.Priority, r2.MsgTypeID64, r2.Description, r2.Rule)
|
_, err = stmt.Exec(r2.Priority, r2.MsgTypeID64, r2.Description, r2.Rule)
|
||||||
@ -59,9 +61,12 @@ func resetMsgParsingRules() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
count += 1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Printf("resetMsgParsingRules : %d rules loaded.\n", count)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user