feat: add calibration sync system.
This commit is contained in:
@@ -144,9 +144,14 @@ app.include_router(fleet_calendar.router)
|
||||
from backend.routers import deployments
|
||||
app.include_router(deployments.router)
|
||||
|
||||
# Calibration sync router (SFM-driven cal date updates)
|
||||
from backend.routers import calibration
|
||||
app.include_router(calibration.router)
|
||||
|
||||
# Start scheduler service and device status monitor on application startup
|
||||
from backend.services.scheduler import start_scheduler, stop_scheduler
|
||||
from backend.services.device_status_monitor import start_device_status_monitor, stop_device_status_monitor
|
||||
from backend.services.calibration_sync import get_calibration_sync_scheduler
|
||||
|
||||
@app.on_event("startup")
|
||||
async def startup_event():
|
||||
@@ -159,6 +164,10 @@ async def startup_event():
|
||||
await start_device_status_monitor()
|
||||
logger.info("Device status monitor started")
|
||||
|
||||
logger.info("Starting calibration sync scheduler...")
|
||||
get_calibration_sync_scheduler().start()
|
||||
logger.info("Calibration sync scheduler started")
|
||||
|
||||
@app.on_event("shutdown")
|
||||
def shutdown_event():
|
||||
"""Clean up services on app shutdown"""
|
||||
@@ -170,6 +179,10 @@ def shutdown_event():
|
||||
stop_scheduler()
|
||||
logger.info("Scheduler service stopped")
|
||||
|
||||
logger.info("Stopping calibration sync scheduler...")
|
||||
get_calibration_sync_scheduler().stop()
|
||||
logger.info("Calibration sync scheduler stopped")
|
||||
|
||||
|
||||
# Legacy routes from the original backend
|
||||
from backend import routes as legacy_routes
|
||||
|
||||
Reference in New Issue
Block a user