This commit is contained in:
2020-09-20 17:28:09 +02:00
parent ef2a02577e
commit 142685b306
14 changed files with 672 additions and 287 deletions

View File

@@ -6,6 +6,15 @@ export const Logs = NeDB.create({
autoload: true,
})
export const Limits = NeDB.create({
filename: 'limits.db',
autoload: true,
})
export function clear() {
return Promise.all([Logs.remove({}, { multi: true }), Limits.remove({}, { multi: true })])
}
export function normalizeTimestamp(timestamp) {
// Normalize every dato to 15 minutes
const t = day(timestamp)