Refactor sensor data publishing and health check server configuration. Updated MQTT topic structure for individual data points, improved error handling, and added garbage collection to manage memory. Enhanced logging for health check server accessibility and sensor status updates.

This commit is contained in:
Naab2k3
2025-06-23 09:39:32 +07:00
parent 81ab6191da
commit b1e111e3f4
5 changed files with 110 additions and 119 deletions

View File

@ -85,6 +85,8 @@ job "poe-sensor" {
env {
LOG_LEVEL = "INFO"
PYTHONUNBUFFERED = "1"
PYTHONDONTWRITEBYTECODE = "1" # Prevent .pyc files to save memory
PYTHONMALLOC = "malloc" # Use system malloc for better memory management
TZ = "Asia/Ho_Chi_Minh"
# MQTT configuration (can be overridden by config.py)
MQTT_BROKER = "mqtt.service.mesh"
@ -96,7 +98,7 @@ job "poe-sensor" {
# Resource allocation
resources {
cpu = 256
memory = 256
memory = 512
}
# Logs configuration