small bugfix, adding catch for main run

main
HerrHase 7 months ago
parent 814bd42b65
commit b78fd0f4f4

@ -23,7 +23,7 @@ if (configs.length === 0) {
} }
// running through configs // running through configs
for (const config in configs) for (const config in configs) {
// check for cron // check for cron
if (!config.hasOwnProperty('cron')) { if (!config.hasOwnProperty('cron')) {
@ -35,6 +35,10 @@ for (const config in configs)
* *
*/ */
const task = cron.schedule(config.cron, async() => { const task = cron.schedule(config.cron, async() => {
try {
const docket = await run(config, docket) const docket = await run(config, docket)
} catch(error) {
logger(config.slug).error(error)
}
}) })
} }

@ -32,4 +32,9 @@ if (configs.length === 0) {
} }
const config = configs[0] const config = configs[0]
try {
const docket = await run(config) const docket = await run(config)
} catch(error) {
logger(config.slug).error(error)
}

Loading…
Cancel
Save