mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 18:10:04 -04:00
Create scripts/commands
This commit is contained in:
parent
b775228d1e
commit
213da67762
9 changed files with 939 additions and 0 deletions
14
scripts/commands/cleanup-database.js
Normal file
14
scripts/commands/cleanup-database.js
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue