mirror of
https://github.com/SophiaAtkinson/discord-hedgedoc-md.git
synced 2025-06-27 06:57:41 -07:00
fix memory leak
This commit is contained in:
17
index.js
17
index.js
@ -132,14 +132,15 @@ async function checkForUpdates(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
|
async function poll() {
|
||||||
|
for (const config of configs) {
|
||||||
|
await checkForUpdates(config);
|
||||||
|
}
|
||||||
|
setTimeout(poll, pollIntervalMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
console.log('🚀 Starting poller...');
|
console.log('🚀 Starting poller...');
|
||||||
for (const config of configs) {
|
await poll();
|
||||||
await checkForUpdates(config);
|
|
||||||
}
|
|
||||||
setInterval(async () => {
|
|
||||||
for (const config of configs) {
|
|
||||||
await checkForUpdates(config);
|
|
||||||
}
|
|
||||||
}, pollIntervalMs);
|
|
||||||
})();
|
})();
|
||||||
|
Reference in New Issue
Block a user