mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 10:00:05 -04:00
Update clear.js
This commit is contained in:
parent
e3f3b1c5ef
commit
430d22e7b6
1 changed files with 3 additions and 0 deletions
|
@ -18,11 +18,14 @@ async function main() {
|
||||||
const streams = await db.streams.all()
|
const streams = await db.streams.all()
|
||||||
|
|
||||||
let total = 0
|
let total = 0
|
||||||
|
logger.info('searching...')
|
||||||
for (const stream of streams) {
|
for (const stream of streams) {
|
||||||
if (
|
if (
|
||||||
stream.status === 'error' &&
|
stream.status === 'error' &&
|
||||||
date.utc().diff(stream.updated_at, 'day') >= options.threshold
|
date.utc().diff(stream.updated_at, 'day') >= options.threshold
|
||||||
) {
|
) {
|
||||||
|
logger.info(stream.url)
|
||||||
|
|
||||||
total += await db.streams.remove({ url: stream.url }, { multi: true })
|
total += await db.streams.remove({ url: stream.url }, { multi: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue