feat: prune server logs table
This commit is contained in:
parent
58b74a6425
commit
a783846b47
1 changed files with 5 additions and 4 deletions
|
|
@ -59,10 +59,11 @@ function update (deviceId, logLines) {
|
|||
}
|
||||
|
||||
function clearOldLogs () {
|
||||
const sql = `delete from logs
|
||||
where timestamp < now() - interval '3 days'`
|
||||
|
||||
return db.none(sql)
|
||||
const sqls = `delete from logs
|
||||
where timestamp < now() - interval '3 days';
|
||||
delete from server_logs
|
||||
where timestamp < now() - interval '3 days';`
|
||||
return db.multi(sqls)
|
||||
}
|
||||
|
||||
function getUnlimitedMachineLogs (deviceId, until = new Date().toISOString()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue