fix: increase Uptime Kuma API timeout and fix status code format

- Increase socket timeout from 30s to 120s (121+ monitors need time to sync)
- Add wait_events=0.2 for reliable login
- Fix accepted_statuscodes format: use 100-increment ranges not arbitrary

[ci skip]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Viktor Barzin 2026-04-14 19:28:18 +00:00
parent 3d189ce4d7
commit c69eba9b46

View file

@ -301,7 +301,7 @@ with open(TARGETS_FILE) as f:
print(f"Loaded {len(targets)} external monitor targets")
api = UptimeKumaApi(UPTIME_KUMA_URL, timeout=30)
api = UptimeKumaApi(UPTIME_KUMA_URL, timeout=120, wait_events=0.2)
api.login("admin", UPTIME_KUMA_PASS)
monitors = api.get_monitors()
@ -323,7 +323,7 @@ for t in targets:
url=t["url"],
interval=300,
maxretries=3,
accepted_statecodes=["200-499"],
accepted_statuscodes=["200-299", "300-399", "400-499"],
)
created += 1
time.sleep(0.3)