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