err handling
This commit is contained in:
@ -156,6 +156,8 @@ class GpsTracksModels {
|
|||||||
const mm = moment.unix(date).format("MM")
|
const mm = moment.unix(date).format("MM")
|
||||||
const yy = moment.unix(date).format("YY")
|
const yy = moment.unix(date).format("YY")
|
||||||
logs.id = resLogs.insertId
|
logs.id = resLogs.insertId
|
||||||
|
|
||||||
|
try {
|
||||||
await MysqlHelpers.queryTrx(
|
await MysqlHelpers.queryTrx(
|
||||||
conn,
|
conn,
|
||||||
`
|
`
|
||||||
@ -164,6 +166,13 @@ class GpsTracksModels {
|
|||||||
`,
|
`,
|
||||||
[logs],
|
[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)
|
// console.log("insert tracks_${yy}${mm} : " + rltm.device_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user