From cc261270893f32c86c8cc4caa9499bfa56c7c29b Mon Sep 17 00:00:00 2001 From: freearhey Date: Sat, 17 Apr 2021 06:22:35 +0300 Subject: [PATCH] Update index.js --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 5515b23..065afe4 100755 --- a/src/index.js +++ b/src/index.js @@ -50,14 +50,12 @@ async function main() { programs.length } programs)` ) - if (options.debug) console.timeEnd(' time') return programs.map(program => { program.lang = program.lang || item.channel.lang || undefined return program }) }) - .then(utils.sleep(config.delay)) .catch(err => { console.log( ` ${config.site} - ${item.channel.xmltv_id} - ${item.date.format( @@ -66,6 +64,10 @@ async function main() { ) console.log(` Error: ${err.message}`) }) + .finally(() => { + if (options.debug) console.timeEnd(' time') + utils.sleep(config.delay) + }) programs = programs.concat(progs) }