err handling
This commit is contained in:
@ -156,14 +156,23 @@ class GpsTracksModels {
|
||||
const mm = moment.unix(date).format("MM")
|
||||
const yy = moment.unix(date).format("YY")
|
||||
logs.id = resLogs.insertId
|
||||
await MysqlHelpers.queryTrx(
|
||||
conn,
|
||||
`
|
||||
INSERT INTO tracks_${yy}${mm}
|
||||
SET ?
|
||||
`,
|
||||
[logs],
|
||||
)
|
||||
|
||||
try {
|
||||
await MysqlHelpers.queryTrx(
|
||||
conn,
|
||||
`
|
||||
INSERT INTO tracks_${yy}${mm}
|
||||
SET ?
|
||||
`,
|
||||
[logs],
|
||||
)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
fs.appendFileSync(
|
||||
path.join(__dirname, `error_data_log.txt`),
|
||||
JSON.stringify(logs) + `\n`,
|
||||
)
|
||||
}
|
||||
// console.log("insert tracks_${yy}${mm} : " + rltm.device_id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user