feat(automations): ctx.tasks.scheduleStatusChange — отложенная смена статуса (воркер 5с, отмена при ручном переходе)

This commit is contained in:
2026-09-17 16:38:56 +03:00
parent c1fe1c4e02
commit e4f9a1992a
9 changed files with 236 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import { notificationService } from "./services/notification.service";
import { webPushService } from "./services/web-push.service";
import { startMedScheduleWorker } from "./medschedule/worker";
import { startAutomationScheduler } from "./workers/automation-scheduler";
import { startDelayedStatusChangeWorker } from "./workers/delayed-status-change.worker";
import { startErrorLogsRetention } from "./workers/error-logs-retention";
import { startGpsWorker } from "./gps/worker";
import { storage } from "./storage";
@@ -1142,6 +1143,10 @@ async function runStartupDataPatches() {
startAutomationScheduler();
log('Automation scheduler started');
// Start delayed status change worker (ctx.tasks.scheduleStatusChange, 5s interval)
startDelayedStatusChangeWorker();
log('Delayed status change worker started');
// Start error_logs retention (daily cleanup of API error log entries older than 30 days)
startErrorLogsRetention();
log('Error logs retention started');