Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,12 +46,18 @@ def send_telegram_message(text):
|
|
46 |
def monitor_status():
|
47 |
"""Background thread to monitor Uma health status."""
|
48 |
global last_health, current_status_text
|
|
|
|
|
49 |
while True:
|
50 |
health = get_health_status()
|
51 |
if health:
|
52 |
msg = STATUS_MESSAGES.get(health, f"Unknown status: {health}")
|
53 |
current_status_text = msg
|
54 |
|
|
|
|
|
|
|
|
|
55 |
if health != last_health:
|
56 |
send_telegram_message(msg)
|
57 |
print(f"[UPDATE] Uma status changed to: {health} - {msg}")
|
|
|
46 |
def monitor_status():
|
47 |
"""Background thread to monitor Uma health status."""
|
48 |
global last_health, current_status_text
|
49 |
+
first_run = True
|
50 |
+
|
51 |
while True:
|
52 |
health = get_health_status()
|
53 |
if health:
|
54 |
msg = STATUS_MESSAGES.get(health, f"Unknown status: {health}")
|
55 |
current_status_text = msg
|
56 |
|
57 |
+
if first_run:
|
58 |
+
send_telegram_message(f"Hi from Stato\nCurrent Uma status:\n{msg}")
|
59 |
+
first_run = False
|
60 |
+
|
61 |
if health != last_health:
|
62 |
send_telegram_message(msg)
|
63 |
print(f"[UPDATE] Uma status changed to: {health} - {msg}")
|