iptv/scripts/commands/cleanup-database.js

15 lines
251 B
JavaScript
Raw Normal View History

2021-12-12 05:10:03 +01:00
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()