Skip to main content

Execution Model

1. Boot Sequence (Main.ts)​

2. MQTT Message Processing Pipeline​

3. Command Dispatch Lifecycle​

4. WebSocket State Propagation​

5. Background Job Execution​

JobTriggerIntervalImplementation
Command SweepersetInterval30sQueries commands where status=dispatched AND created_at < cutoff. Batch updates to expired.
Heartbeat MonitorsetIntervalConfigurableChecks Redis TTL keys per device. If expired → marks device offline, triggers OTA check.
Email WorkerBullMQ consumerContinuous5 concurrent workers, 50/min rate limit, exponential backoff × 5 attempts. Dead-letter on exhaustion.
HX47 Health ChecksetInterval5sChecks heartbeat timestamp gap. 3 consecutive failures → attempt restart with backoff (max 5).

6. Graceful Shutdown Sequence​