Create scripts/commands

This commit is contained in:
Aleksandr Statciuk 2021-12-12 07:10:03 +03:00
parent b775228d1e
commit 213da67762
9 changed files with 939 additions and 0 deletions

View file

@ -0,0 +1,14 @@
const { db, logger } = require('../core')
async function main() {
const removed = await db.remove(
{ 'status.code': { $in: ['timeout', 'offline'] } },
{ multi: true }
)
db.compact()
logger.info(`Removed ${removed} links`)
}
main()