Update index.js

This commit is contained in:
freearhey 2021-04-17 06:22:35 +03:00
parent ff4498e160
commit cc26127089
1 changed files with 4 additions and 2 deletions

View File

@ -50,14 +50,12 @@ async function main() {
programs.length programs.length
} programs)` } programs)`
) )
if (options.debug) console.timeEnd(' time')
return programs.map(program => { return programs.map(program => {
program.lang = program.lang || item.channel.lang || undefined program.lang = program.lang || item.channel.lang || undefined
return program return program
}) })
}) })
.then(utils.sleep(config.delay))
.catch(err => { .catch(err => {
console.log( console.log(
` ${config.site} - ${item.channel.xmltv_id} - ${item.date.format( ` ${config.site} - ${item.channel.xmltv_id} - ${item.date.format(
@ -66,6 +64,10 @@ async function main() {
) )
console.log(` Error: ${err.message}`) console.log(` Error: ${err.message}`)
}) })
.finally(() => {
if (options.debug) console.timeEnd(' time')
utils.sleep(config.delay)
})
programs = programs.concat(progs) programs = programs.concat(progs)
} }