diff --git a/features/status-dashboard/server/src/cron/alert.service.ts b/features/status-dashboard/server/src/cron/alert.service.ts index 70839a70b..a38dcbb10 100644 --- a/features/status-dashboard/server/src/cron/alert.service.ts +++ b/features/status-dashboard/server/src/cron/alert.service.ts @@ -39,42 +39,42 @@ export class AlertService { /** * Send resource threshold alert */ - async sendResourceAlert( + sendResourceAlert( resourceType: string, currentValue: number, threshold: number, unit: string, - ): Promise { + ): void { const currentFixed = currentValue.toFixed(1); const message = `${resourceType} usage exceeds threshold: ${currentFixed}${unit} (threshold: ${threshold}${unit})`; - await this.sendAlert(message, 'warning'); + this.sendAlert(message, 'warning'); } /** * Send critical resource alert */ - async sendCriticalResourceAlert( + sendCriticalResourceAlert( resourceType: string, currentValue: number, threshold: number, unit: string, - ): Promise { + ): void { const currentFixed = currentValue.toFixed(1); const message = `CRITICAL: ${resourceType} usage critically high: ${currentFixed}${unit} (threshold: ${threshold}${unit})`; - await this.sendAlert(message, 'critical'); + this.sendAlert(message, 'critical'); } /** * Send container health alert */ - async sendContainerAlert( + sendContainerAlert( containerName: string, state: string, health: string | null, - ): Promise { + ): void { const healthStatus = health ? ` (health: ${health})` : ''; const message = `Container ${containerName} is ${state}${healthStatus}`; const severity = state === 'exited' || state === 'dead' || health === 'unhealthy' ? 'critical' : 'warning'; - await this.sendAlert(message, severity); + this.sendAlert(message, severity); } } diff --git a/features/status-dashboard/server/src/cron/vps-monitoring.cron.ts b/features/status-dashboard/server/src/cron/vps-monitoring.cron.ts index b872e4c18..507d11783 100644 --- a/features/status-dashboard/server/src/cron/vps-monitoring.cron.ts +++ b/features/status-dashboard/server/src/cron/vps-monitoring.cron.ts @@ -80,7 +80,7 @@ export class VPSMonitoringCron implements OnModuleInit { // Alert on high CPU usage const cpuThreshold = this.configService.monitoring.cpuThreshold || 90; if (resources.cpu.percent > cpuThreshold) { - await this.alertService.sendCriticalResourceAlert( + this.alertService.sendCriticalResourceAlert( 'CPU', resources.cpu.percent, cpuThreshold, @@ -91,7 +91,7 @@ export class VPSMonitoringCron implements OnModuleInit { // Alert on high memory usage const memoryThreshold = this.configService.monitoring.memoryThreshold || 85; if (resources.memory.percent > memoryThreshold) { - await this.alertService.sendCriticalResourceAlert( + this.alertService.sendCriticalResourceAlert( 'Memory', resources.memory.percent, memoryThreshold, @@ -102,7 +102,7 @@ export class VPSMonitoringCron implements OnModuleInit { // Alert on high disk usage const diskThreshold = this.configService.monitoring.diskThreshold || 90; if (resources.disk.percent > diskThreshold) { - await this.alertService.sendResourceAlert( + this.alertService.sendResourceAlert( 'Disk', resources.disk.percent, diskThreshold, @@ -146,7 +146,7 @@ export class VPSMonitoringCron implements OnModuleInit { container.state === 'exited' || container.state === 'dead' ) { - await this.alertService.sendContainerAlert( + this.alertService.sendContainerAlert( container.name, container.state, container.health, @@ -190,7 +190,7 @@ export class VPSMonitoringCron implements OnModuleInit { ); for (const event of criticalEvents) { - await this.alertService.sendAlert( + this.alertService.sendAlert( `Docker event: ${event.containerName} - ${event.action}`, 'warning', );