This commit is contained in:
shoopea 2020-01-02 23:17:22 +08:00
parent 6650f650ae
commit eb954d56a6

View File

@ -7,6 +7,7 @@ import (
func resetMsgParsingRules() error {
var rules, rules2 []MessageParsingRule
var count int64
b, err := Asset("data/msg_rules.json")
logOnError(err, "resetMsgParsingRules : load data/msg_rules.json")
@ -52,6 +53,7 @@ func resetMsgParsingRules() error {
return err
}
defer stmt.Close()
count = 0
for _, r2 := range rules2 {
_, err = stmt.Exec(r2.Priority, r2.MsgTypeID64, r2.Description, r2.Rule)
@ -59,9 +61,12 @@ func resetMsgParsingRules() error {
if err != nil {
return err
}
count += 1
}
fmt.Printf("resetMsgParsingRules : %d rules loaded.\n", count)
return nil
}