Add POI feature and imporve the overall backend implementation

This commit is contained in:
Urtzi Alfaro
2025-11-12 15:34:10 +01:00
parent e8096cd979
commit 5783c7ed05
173 changed files with 16862 additions and 9078 deletions

View File

@@ -89,11 +89,28 @@ class POSService(StandardFastAPIService):
async def on_startup(self, app: FastAPI):
"""Custom startup logic for POS service"""
# Start background scheduler for POS-to-Sales sync
try:
from app.scheduler import start_scheduler
start_scheduler()
self.logger.info("Background scheduler started successfully")
except Exception as e:
self.logger.error(f"Failed to start background scheduler: {e}", exc_info=True)
# Don't fail startup if scheduler fails
# Custom startup completed
self.logger.info("POS Integration Service started successfully")
async def on_shutdown(self, app: FastAPI):
"""Custom shutdown logic for POS service"""
# Shutdown background scheduler
try:
from app.scheduler import shutdown_scheduler
shutdown_scheduler()
self.logger.info("Background scheduler stopped successfully")
except Exception as e:
self.logger.error(f"Failed to stop background scheduler: {e}", exc_info=True)
# Database cleanup is handled by the base class
pass