add cacheable dns, stagger start times
This commit is contained in:
1 parent
bd2ba804ee
commit
30a9309bd8
3 files changed
+18
-3
No files matched your search
@@ -35,8 +35,12 @@ class SuperSimpleQueue {
|
||||
this.scheduler.addTemplate("monitor-job", this.helper.getMonitorJob());
|
||||
const monitors = await this.db.monitorModule.getAllMonitors();
|
||||
for (const monitor of monitors) {
|
||||
await this.addJob(monitor._id, monitor);
|
||||
const randomOffset = Math.floor(Math.random() * monitor.interval);
|
||||
setTimeout(() => {
|
||||
this.addJob(monitor);
|
||||
}, randomOffset);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
this.logger.error({
|
||||
|
||||
Reference in new issue
Block a user