Add the interval to env with default

This commit is contained in:
Logan Cusano
2023-02-25 21:42:34 -05:00
parent 3266a1550e
commit b1f7b1deef

View File

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