This commit is contained in:
shoopea 2019-05-08 19:00:43 +08:00
parent b37ca8547b
commit 683fbdd84a

9
sql.go
View File

@ -289,10 +289,17 @@ func loadMsgParsingRules() (map[int]MessageParsingRule, error) {
)
log.Println("Loading message parsing rules...")
m := make(map[int]MessageParsingRule)
count := int(0)
defer func() {
if rec := recover(); rec != nil {
log.Printf("loadMsgParsingRules : panic (%s) \n", rec)
err := error.New("Can't load message parsing rules.")
return m, err
}
}()
rules, err := db.Query(`SELECT r.id, r.prio, r.descn, r.rule, r.msg_type_id FROM msg_rules r ORDER BY r.prio DESC;`)
if err != nil {
return m, err