diff --git a/server/src/domain/app-settings/app-settings.service.ts b/server/src/domain/app-settings/app-settings.service.ts index 12f75d1c8..2df2b7512 100755 --- a/server/src/domain/app-settings/app-settings.service.ts +++ b/server/src/domain/app-settings/app-settings.service.ts @@ -20,7 +20,6 @@ export type EnvConfig = { }; export interface ISettingsService { - loadSettings(): EnvConfig; getSettings(): EnvConfig; areStatusPageThemesEnabled(): boolean; getDBSettings(): Promise; @@ -56,10 +55,6 @@ export class SettingsService implements ISettingsService { this.settingsRepository = settingsRepository; } - loadSettings() { - return this.settings; - } - getSettings() { return this.settings; } diff --git a/server/src/domain/queue-workers/queue-worker.model.ts b/server/src/domain/queue-workers/queue-worker.model.ts index 0dd90b5c5..c89ecca5d 100644 --- a/server/src/domain/queue-workers/queue-worker.model.ts +++ b/server/src/domain/queue-workers/queue-worker.model.ts @@ -4,7 +4,8 @@ import { QueueWorkerDocument } from "@/domain/queue-workers/queue-worker.type.js // Single source of truth for worker liveness: the TTL that GCs stale records and // the window readers use to count a worker as alive. Heartbeat cadence must stay well below it. -export const WORKER_TTL_SECONDS = 180; +const WORKER_TTL_SECONDS = 180; +export const WORKER_STALE_MS = WORKER_TTL_SECONDS * 1000; const QueueWorkerSchema = new Schema( { diff --git a/server/src/index.ts b/server/src/index.ts index b5e870ded..68ef00a1f 100755 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -27,7 +27,7 @@ const startApp = async () => { const env = validateEnv(logger); logger.setLogLevel(env.LOG_LEVEL); const settingsService = new SettingsService(env); - const envSettings = settingsService.loadSettings(); + const envSettings = settingsService.getSettings(); const { queueMode, queuePrimaryProcesses } = envSettings; logger.info({ diff --git a/server/src/service/emailService.ts b/server/src/service/emailService.ts index f057e955a..26b89f84b 100755 --- a/server/src/service/emailService.ts +++ b/server/src/service/emailService.ts @@ -75,7 +75,6 @@ export class EmailService implements IEmailService { this.templateLookup = { welcomeEmailTemplate: loadTemplate("welcomeEmail"), employeeActivationTemplate: loadTemplate("employeeActivation"), - noIncidentsThisWeekTemplate: loadTemplate("noIncidentsThisWeek"), passwordResetTemplate: loadTemplate("passwordReset"), testEmailTemplate: loadTemplate("testEmailTemplate"), unifiedNotificationTemplate: loadTemplate("unifiedNotification"), diff --git a/server/src/templates/addReview.mjml b/server/src/templates/addReview.mjml deleted file mode 100755 index e193ac1ba..000000000 --- a/server/src/templates/addReview.mjml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - Message from Checkmate Service - - - - - - -

Hello {{ name }}!

-

- We hope you’re finding Checkmate helpful in monitoring your infrastructure. Your support means a lot to us, and we - truly appreciate having you as part of our community. -

-

- If you’re happy with Checkmate, we’d love to hear about your experience! Leaving a review on G2 helps others discover Checkmate and - supports our ongoing improvements. -

- G2 Link: TBD -

Thank you for taking the time to share your thoughts - we greatly appreciate it!

- Checkmate Team -
-
- - - -

This email was sent by Checkmate.

-
-
-
-
-
diff --git a/server/src/templates/noIncidentsThisWeek.mjml b/server/src/templates/noIncidentsThisWeek.mjml deleted file mode 100755 index d160e44de..000000000 --- a/server/src/templates/noIncidentsThisWeek.mjml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - Message from Checkmate Service - - - No incidents this week! - - - - - - -

Hello {{ name }}!

-

There were no incidents this week. Good job!

-

Current monitors:

-

Google: 100% availability

-

Canada.ca:100% availability

-
-
- - - -

This email was sent by Checkmate.

-
-
-
-
-
diff --git a/server/src/worker/worker.db-queue.ts b/server/src/worker/worker.db-queue.ts index 9420660c7..6f4f31353 100644 --- a/server/src/worker/worker.db-queue.ts +++ b/server/src/worker/worker.db-queue.ts @@ -11,14 +11,13 @@ import { ICheckPipeline } from "@/worker/worker.check-pipeline.js"; import { IReactorDispatcher } from "@/worker/reactors/reactor.dispatcher.js"; import { IWorkerHelper } from "@/worker/worker.helper.js"; import { IQueueWorkersRepository } from "@/domain/queue-workers/queue-worker.repository.interface.js"; -import { WORKER_TTL_SECONDS } from "@/domain/queue-workers/queue-worker.model.js"; +import { WORKER_STALE_MS } from "@/domain/queue-workers/queue-worker.model.js"; import { QueueMode } from "@/domain/app-settings/app-settings.type.js"; import { JobScheduler } from "@/worker/worker.job-scheduler.js"; import { IBufferService } from "@/service/bufferService.js"; +import { POLL_MS } from "@/worker/worker.job-scheduler.js"; const SERVICE_NAME = "JobQueue"; -const POLL_MS = 250; // base poll interval while a loop is actively claiming work const POLL_MAX_MS = 5000; // back off poll interval to 5s if no jobs -const WORKER_STALE_MS = WORKER_TTL_SECONDS * 1000; // a worker counts as alive if seen within this window const LOCK_RENEW_MS = LOCK_MS / 3; // renew an in-flight job's lock at 1/3 the lease, so it survives two missed renewals const DRAIN_TIMEOUT_MS = 25_000; const DRAIN_POLL_MS = 200; diff --git a/server/src/worker/worker.job-scheduler.ts b/server/src/worker/worker.job-scheduler.ts index 0f04a39b7..433e69955 100644 --- a/server/src/worker/worker.job-scheduler.ts +++ b/server/src/worker/worker.job-scheduler.ts @@ -5,13 +5,12 @@ import { Monitor, supportsGeoCheck } from "@/domain/monitors/monitor.types.js"; import { type Job, type JobSeed, type JobType, jobId } from "@/domain/jobs/job.type.js"; import { IQueueWorkersRepository } from "@/domain/queue-workers/queue-worker.repository.interface.js"; import { WorkerJobsPagination, WorkerJobSummary, WorkerMetrics } from "@/worker/worker.interface.js"; -import { WORKER_TTL_SECONDS } from "@/domain/queue-workers/queue-worker.model.js"; +import { WORKER_STALE_MS } from "@/domain/queue-workers/queue-worker.model.js"; import { QueueMode } from "@/domain/app-settings/app-settings.type.js"; import { ILogger } from "@/utils/logger.js"; -const POLL_MS = 250; // base poll interval while a loop is actively claiming work +export const POLL_MS = 250; // base poll interval while a loop is actively claiming work const SERVICE_NAME = "JobScheduler"; -const WORKER_STALE_MS = WORKER_TTL_SECONDS * 1000; // a worker counts as alive if seen within this window const HEARTBEAT_MS = WORKER_STALE_MS / 3; // Worker can miss two beats without being considered stale const CLEANUP_INTERVAL_MS = 24 * 60 * 60 * 1000;