Add check for monitor active state before adding jobs to queue on startup
This commit is contained in:
1 parent
cac89947a4
commit
91909ed350
1 file changed
+3
-1
@@ -39,7 +39,9 @@ class JobQueue {
|
|||||||
queue.networkService = networkService;
|
queue.networkService = networkService;
|
||||||
const monitors = await db.getAllMonitors();
|
const monitors = await db.getAllMonitors();
|
||||||
for (const monitor of monitors) {
|
for (const monitor of monitors) {
|
||||||
await queue.addJob(monitor.id, monitor);
|
if (monitor.active) {
|
||||||
|
await queue.addJob(monitor.id, monitor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const workerStats = await queue.getWorkerStats();
|
const workerStats = await queue.getWorkerStats();
|
||||||
await queue.scaleWorkers(workerStats);
|
await queue.scaleWorkers(workerStats);
|
||||||
|
|||||||
Reference in new issue
Block a user