Spaces:
Running
Running
Update app/app.py
Browse files- app/app.py +3 -16
app/app.py
CHANGED
|
@@ -134,17 +134,7 @@ async def mcp_endpoint():
|
|
| 134 |
# pass
|
| 135 |
|
| 136 |
|
| 137 |
-
|
| 138 |
-
# Heartbeat — runs parallel to hypercorn via asyncio.gather()
|
| 139 |
-
# =============================================================================
|
| 140 |
-
async def heartbeat() -> None:
|
| 141 |
-
"""
|
| 142 |
-
Periodic heartbeat log to confirm the application is alive.
|
| 143 |
-
Runs parallel to hypercorn in the same event loop via asyncio.gather().
|
| 144 |
-
"""
|
| 145 |
-
while True:
|
| 146 |
-
await asyncio.sleep(60)
|
| 147 |
-
logger.debug("Heartbeat.")
|
| 148 |
|
| 149 |
|
| 150 |
# =============================================================================
|
|
@@ -211,11 +201,8 @@ async def start_application(fundaments: Dict[str, Any]) -> None:
|
|
| 211 |
logger.info(f"Starting hypercorn on port {port}...")
|
| 212 |
logger.info("All services running.")
|
| 213 |
|
| 214 |
-
# --- Run hypercorn
|
| 215 |
-
await
|
| 216 |
-
serve(app, config), # hypercorn — blocks until shutdown
|
| 217 |
-
heartbeat() # heartbeat — runs parallel in same event loop
|
| 218 |
-
)
|
| 219 |
|
| 220 |
|
| 221 |
# =============================================================================
|
|
|
|
| 134 |
# pass
|
| 135 |
|
| 136 |
|
| 137 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
|
| 140 |
# =============================================================================
|
|
|
|
| 201 |
logger.info(f"Starting hypercorn on port {port}...")
|
| 202 |
logger.info("All services running.")
|
| 203 |
|
| 204 |
+
# --- Run hypercorn — blocks until shutdown ---
|
| 205 |
+
await serve(app, config)
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
|
| 208 |
# =============================================================================
|