Added None guards to satisfy mypy strict union-attr checks.
CD / Build (push) Successful in 8s
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (push) Successful in 10s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s

This commit is contained in:
2026-03-14 16:51:37 -04:00
parent a01ad9440c
commit 90aa6afcc6
2 changed files with 8 additions and 2 deletions
+5 -2
View File
@@ -188,6 +188,8 @@ class CommandHandler:
for domain in subscribed_domains:
# Get the stream state from the database
stream_state = await self.stream_repo.get_by_domain(domain)
if stream_state is None:
continue
# Determine stream name (use domain as fallback)
stream_name = stream_state.name if stream_state.name else domain
@@ -204,8 +206,9 @@ class CommandHandler:
# Determine status and duration (as a sub-bullet)
if stream_state.status == StreamStatus.ONLINE:
# Stream is online - use last_connect_time
duration = self._format_duration(stream_state.last_connect_time)
body_text += f" - Status: Online for {duration} \n"
if stream_state.last_connect_time:
duration = self._format_duration(stream_state.last_connect_time)
body_text += f" - Status: Online for {duration} \n"
elif stream_state.status == StreamStatus.UNKNOWN:
# Stream status is unknown - instance unreachable
body_text += " - Status: Unknown (instance unreachable) \n"
+3
View File
@@ -114,6 +114,9 @@ class StreamMonitor:
old_state = await self.stream_repo.get_by_domain(domain)
failure_counter = old_state.failure_counter if old_state else 0
if old_state is None:
return True
# Check if we should query this stream based on backoff schedule
if not should_query_stream(failure_counter):
# Skip this cycle, increment counter to track time passage