remove rtt
This commit is contained in:
1 parent
124a8c0b07
commit
2f1a164c26
8 files changed
+29
-34
No files matched your search
@@ -2,6 +2,7 @@ import { IMonitorsRepository } from "@/repositories/index.js";
|
||||
import { ILogger } from "@/utils/logger.js";
|
||||
import Scheduler from "super-simple-scheduler";
|
||||
import { ISuperSimpleQueueHelper } from "@/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.js";
|
||||
import { supportsGeoCheck } from "@/types/monitor.js";
|
||||
const SERVICE_NAME = "JobQueue";
|
||||
|
||||
type QueueJobFailure = {
|
||||
@@ -126,7 +127,7 @@ export class SuperSimpleQueue implements ISuperSimpleQueue {
|
||||
});
|
||||
|
||||
// Return early if we don't need geo checks
|
||||
if (monitor.type !== "http" && monitor.type !== "ping") {
|
||||
if (!supportsGeoCheck(monitor.type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,7 +181,7 @@ export class SuperSimpleQueue implements ISuperSimpleQueue {
|
||||
|
||||
// Handle geo check job lifecycle
|
||||
const geoJobId = `${monitor.id}-geo`;
|
||||
if (monitor.geoCheckEnabled && (monitor.type === "http" || monitor.type === "ping")) {
|
||||
if (monitor.geoCheckEnabled && supportsGeoCheck(monitor.type)) {
|
||||
// Check if geo job exists
|
||||
const existingGeoJob = await this.scheduler.getJob(geoJobId);
|
||||
if (existingGeoJob) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const SERVICE_NAME = "JobQueueHelper";
|
||||
import type { Monitor } from "@/types/monitor.js";
|
||||
import { supportsGeoCheck } from "@/types/monitor.js";
|
||||
import { AppError } from "@/utils/AppError.js";
|
||||
import { INetworkService, INotificationsService, IStatusService, IncidentService, type IGeoChecksService } from "@/service/index.js";
|
||||
import type { StatusChangeResult } from "@/types/index.js";
|
||||
@@ -283,9 +284,9 @@ export class SuperSimpleQueueHelper implements ISuperSimpleQueueHelper {
|
||||
if (!monitor.geoCheckEnabled) {
|
||||
return;
|
||||
}
|
||||
if (monitor.type !== "http" && monitor.type !== "ping") {
|
||||
if (!supportsGeoCheck(monitor.type)) {
|
||||
this.logger.debug({
|
||||
message: `Monitor ${monitorId} is not HTTP or Ping type, skipping geo check`,
|
||||
message: `Monitor ${monitorId} type does not support geo checks, skipping`,
|
||||
service: SERVICE_NAME,
|
||||
method: "getGeoCheckJob",
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user