add pings table

This commit is contained in:
Josh Harvey 2017-05-15 02:02:43 +03:00
parent 31f7795fd7
commit a123170622
4 changed files with 43 additions and 13 deletions

View file

@ -44,7 +44,7 @@ exports.machineEvent = function machineEvent (rec) {
const deleteSql = `delete from machine_events
where device_id=$1
and event_type=$2
and created < now() - interval '2 hours'`
and created < now() - interval '2 days'`
return db.none(sql, values)
.then(() => db.none(deleteSql, [rec.deviceId, rec.eventType]))