This commit is contained in:
shoopea 2019-12-29 20:54:41 +08:00
parent 511d1364d7
commit c572bc652e

View File

@ -19,10 +19,9 @@ func resetMsgParsingRules2() error {
err = json.Unmarshal(b, &rules)
for k, _ := range rules {
// b, err := json.Marshal(r)
// log.Printf("Rule : %s\n", string(b))
r := rules[k]
b, err := json.Marshal(r)
log.Printf("Rule : %s\n", string(b))
r.MsgTypeID64, err = codeObjSubTypeId(r.MsgType)
logOnError(err, "resetMsgParsingRules2 : codeObjSubTypeId("+r.MsgType+")")
@ -51,6 +50,10 @@ func resetMsgParsingRules2() error {
}
defer stmt.Close()
for _, r := range rules {
b, err := json.Marshal(r)
log.Printf("Rule2 : %s\n", string(b))
_, err = stmt.Exec(r.Priority, r.MsgTypeID64, r.Description, r.Rule)
logOnError(err, "resetMsgParsingRules2 : insert statement "+r.Description)
if err != nil {