Add the interval to env with default
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user