Removed unreachable defensive checks and added tests for edge case display states.
CD / Build (push) Successful in 8s
CI / Formatting (push) Successful in 6s
CI / Linting (push) Successful in 6s
CI / Tests (push) Successful in 11s
CI / Type Checking (push) Failing after 9s
CI / Spelling (push) Successful in 6s

This commit is contained in:
2026-03-14 12:25:07 -04:00
parent 99b257b90a
commit 8931db33e8
3 changed files with 66 additions and 47 deletions
+1 -9
View File
@@ -127,11 +127,6 @@ class StreamMonitor:
# Backoff is expected behavior, not a failure
return True
# Defensive check: old_state should always exist here since
# the stream is in the DB
if old_state is None:
return False
# Flag: first state update of a brand-new stream to avoid
# sending notifications if it's already live.
first_update = False
@@ -281,10 +276,7 @@ class StreamMonitor:
# Yep. This stream is now offline. Log it.
update_database = True
self.offline_timer_cache[domain] = time.time()
if first_update:
self.log.info(f"[{domain}] Stream is offline.")
else:
self.log.info(f"[{domain}] Stream is now offline.")
self.log.info(f"[{domain}] Stream is now offline.")
# Update the database with current stream state, if needed.
if update_database: