Move all notification handling from JobQueue to NotificaitonService where it should be
This commit is contained in:
1 parent
257cc73ab3
commit
02666397c9
2 files changed
+80
-45
No files matched your search
@@ -165,26 +165,12 @@ class JobQueue {
|
||||
// Handle status change
|
||||
const { monitor, statusChanged, prevStatus } =
|
||||
await this.statusService.updateStatus(networkResponse);
|
||||
|
||||
// If this is an infrastructure monitor, we need to check for thresholds
|
||||
if (monitor.type === "hardware") {
|
||||
await this.notificationService.handleInfrastructureNotifications({
|
||||
...networkResponse,
|
||||
monitor,
|
||||
prevStatus,
|
||||
});
|
||||
}
|
||||
|
||||
//If status hasn't changed, we're done
|
||||
if (statusChanged === false) return;
|
||||
|
||||
// if prevStatus is undefined, monitor is resuming, we're done
|
||||
if (prevStatus === undefined) return;
|
||||
|
||||
// Handle notifications
|
||||
this.notificationService.handleNotifications({
|
||||
...networkResponse,
|
||||
monitor,
|
||||
prevStatus,
|
||||
statusChanged,
|
||||
});
|
||||
} catch (error) {
|
||||
this.logger.error({
|
||||
|
||||
Reference in new issue
Block a user