Update index.js
This commit is contained in:
parent
1e42b106db
commit
c09a837868
|
@ -14,6 +14,8 @@ const Result = {
|
|||
|
||||
module.exports = {
|
||||
grab: async function (channel, config, cb) {
|
||||
config = utils.loadConfig(config)
|
||||
|
||||
const utcDate = utils.getUTCDate()
|
||||
const dates = Array.from({ length: config.days }, (_, i) => utcDate.add(i, 'd'))
|
||||
const queue = []
|
||||
|
@ -21,8 +23,6 @@ module.exports = {
|
|||
queue.push({ date, channel })
|
||||
})
|
||||
|
||||
config = utils.loadConfig(config)
|
||||
|
||||
let programs = []
|
||||
for (let item of queue) {
|
||||
await utils
|
||||
|
@ -35,7 +35,8 @@ module.exports = {
|
|||
programs = programs.concat(results)
|
||||
})
|
||||
.catch(err => {
|
||||
cb(null, err)
|
||||
item.programs = []
|
||||
cb(item, err)
|
||||
})
|
||||
|
||||
await utils.sleep(config.delay)
|
||||
|
|
Loading…
Reference in New Issue