log error message but not by pass record DB when query location info fail on issue happens

This commit is contained in:
r0n1n7an 2024-03-21 18:18:16 +08:00
parent c3cca4bd2b
commit 62c8b6fa2b
2 changed files with 3 additions and 6 deletions

Binary file not shown.

View File

@ -60,14 +60,11 @@ func (e *EWS) RecordIssue(cfg cnf.Cfg, logger *log.Logger, host string, addr str
locTime := ""
loc := dbo.QueryRow(fmt.Sprintf(`SELECT line,col,row,num,DATE_FORMAT(update_time,'%%Y-%%m-%%d %%H:%%i:%%s') FROM locinfo WHERE mac='%s';`, params["MAC"]))
err := loc.Scan(&line, &col, &row, &num, &locTime)
if locTime == "" {
locTime = "0000-00-00 00:00:00"
}
if err != nil {
logger.Printf("[ERR] %s; %s; %#v; %s\r\n", addr, uri, params, err.Error())
rst["RESULT"] = "NG"
rst["ErrMsg"] = err.Error()
return rst
}
if locTime == "" {
locTime = "0000-00-00 00:00:00"
}
stmt, err := dbo.Prepare(