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); }