Spaces:
Runtime error
Runtime error
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -2828,21 +2828,8 @@ def main():
|
|
| 2828 |
"timestamp": _dt.datetime.utcnow().isoformat(),
|
| 2829 |
})
|
| 2830 |
|
| 2831 |
-
|
| 2832 |
|
| 2833 |
-
# ============================================================
|
| 2834 |
-
# DIAGNOSTIC: /health — проверяет доступность HF Space снаружи
|
| 2835 |
-
# ============================================================
|
| 2836 |
-
async def health_check_handler(request: aiohttp.web.Request) -> aiohttp.web.Response:
|
| 2837 |
-
logger.info("🔍 [HEALTH] GET /health — внешний запрос проверки")
|
| 2838 |
-
return aiohttp.web.json_response({
|
| 2839 |
-
"status": "alive",
|
| 2840 |
-
"service": "freshpixels-ai-sprint-bot",
|
| 2841 |
-
"webhook_set": True,
|
| 2842 |
-
"timestamp": datetime.utcnow().isoformat(),
|
| 2843 |
-
})
|
| 2844 |
-
|
| 2845 |
-
app.router.add_get('/health', health_check_handler)
|
| 2846 |
# 3. Запускаем бизнес-логику
|
| 2847 |
app.on_startup.append(on_startup)
|
| 2848 |
app.on_shutdown.append(on_shutdown)
|
|
|
|
| 2828 |
"timestamp": _dt.datetime.utcnow().isoformat(),
|
| 2829 |
})
|
| 2830 |
|
| 2831 |
+
app.router.add_get('/health', health_check_handler, allow_head=False)
|
| 2832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2833 |
# 3. Запускаем бизнес-логику
|
| 2834 |
app.on_startup.append(on_startup)
|
| 2835 |
app.on_shutdown.append(on_shutdown)
|