iptv/scripts/commands/cleanup-database.js
2021-12-12 07:10:03 +03:00

15 lines
251 B
JavaScript

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()