Merge dev to main: Security improvements and comprehensive test infrastructure #39
@@ -39,20 +39,24 @@ async def lifespan(app: FastAPI):
|
|||||||
|
|
||||||
# Start agent executor service
|
# Start agent executor service
|
||||||
from services import agent_executor
|
from services import agent_executor
|
||||||
|
executor_task = None
|
||||||
try:
|
try:
|
||||||
asyncio.create_task(agent_executor.start_executor())
|
executor_task = asyncio.create_task(agent_executor.start_executor())
|
||||||
print("Agent executor service started")
|
print("Agent executor service started")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Failed to start agent executor: {e}")
|
print(f"Failed to start agent executor: {e}")
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
asyncio.create_task(monitor_containers())
|
monitor_task = asyncio.create_task(monitor_containers())
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
# Shutdown
|
# Shutdown
|
||||||
print("=== Application Shutdown ===")
|
print("=== Application Shutdown ===")
|
||||||
|
if executor_task:
|
||||||
|
executor_task.cancel()
|
||||||
|
monitor_task.cancel()
|
||||||
|
|
||||||
limiter = Limiter(key_func=get_remote_address)
|
limiter = Limiter(key_func=get_remote_address)
|
||||||
app = FastAPI(title="NAS Dashboard", lifespan=lifespan)
|
app = FastAPI(title="NAS Dashboard", lifespan=lifespan)
|
||||||
|
|||||||
Reference in New Issue
Block a user