From 25ed5af433d5e2667ab7a26c71b8b975e91e9056 Mon Sep 17 00:00:00 2001 From: "karl.hudgell" Date: Sat, 18 Jun 2022 13:58:29 +0100 Subject: [PATCH] quick config.json check --- JDRssDownloader.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/JDRssDownloader.js b/JDRssDownloader.js index 3f7c6a2..1d7766b 100644 --- a/JDRssDownloader.js +++ b/JDRssDownloader.js @@ -9,14 +9,16 @@ global.log = require('simple-node-logger').createSimpleLogger({ }); async function main() { - let RSSFeedRefreshMins = JSON.parse(fs.readFileSync('config.json')).RSSFeedRefreshMins - let JDPostLinksMins = JSON.parse(fs.readFileSync('config.json')).JDPostLinksMins - log.info('Running JDRssDownloader version ' + version) + try { + RSSFeedRefreshMins = JSON.parse(fs.readFileSync('config.json')).RSSFeedRefreshMins + JDPostLinksMins = JSON.parse(fs.readFileSync('config.json')).JDPostLinksMins + } catch (error) { + log.error('config.json file is missing.') + } log.info('Refreshing RSS Items every ' + RSSFeedRefreshMins + ' Minutes') log.info('Checking for links and sending to JDdownloader every ' + JDPostLinksMins + ' Minutes') - setInterval(await feedUpdater, RSSFeedRefreshMins * 60000); setInterval(await filterFeed, JDPostLinksMins * 60000); }