Add POI feature and imporve the overall backend implementation
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user