Create utils/health.py
Browse files- utils/health.py +11 -0
utils/health.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
from datetime import datetime, timezone
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def health_payload(boot_time: float) -> dict:
|
| 6 |
+
return {
|
| 7 |
+
"ok": True,
|
| 8 |
+
"service": "qwen-telegram-bot",
|
| 9 |
+
"uptime_seconds": int(time.time() - boot_time),
|
| 10 |
+
"timestamp": datetime.now(timezone.utc).isoformat(),
|
| 11 |
+
}
|