From b1f7b1deefb1252527e599947026647f562c1d44 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sat, 25 Feb 2023 21:42:34 -0500 Subject: [PATCH] Add the interval to env with default --- controllers/rssController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/rssController.js b/controllers/rssController.js index 901a72a..584010a 100644 --- a/controllers/rssController.js +++ b/controllers/rssController.js @@ -6,6 +6,8 @@ const log = new DebugBuilder("server", "rssController"); const libCore = require("../libCore"); const libUtils = require("../libUtils"); +const timeoutValue = process.env.RSS_TIMEOUT_VALUE ?? 300000; + exports.RSSController = class RSSController { constructor(_client) { this.client = _client; @@ -14,7 +16,7 @@ exports.RSSController = class RSSController { async start(){ log.INFO("Starting RSS Controller"); while(true){ - await new Promise(resolve => setTimeout(resolve, 10000)); + await new Promise(resolve => setTimeout(resolve, timeoutValue)); this.collectLatestPosts(); } }