Streamline SSE client setup in tellupdater by removing redundant HTTP stream handling

This commit is contained in:
GotthardG
2026-03-13 09:35:21 +01:00
parent 886bdcc032
commit 68df2930b3
+2 -5
View File
@@ -4,7 +4,6 @@ import threading
import websocket
import sseclient
import requests
import time
from aareDB.models import PuckWithTellPosition
@@ -40,10 +39,8 @@ def listen_to_sse():
return
sse_url = tell_client.url + "/events"
try:
# Build a streaming HTTP response first to support common sseclient variants.
response = requests.get(sse_url, stream=True, timeout=(5, 60))
response.raise_for_status()
client = sseclient.SSEClient(response)
# Use URL directly for sseclient variants that manage their own HTTP stream.
client = sseclient.SSEClient(sse_url)
print("[SSE][listen_to_sse] Initial detected pucks fetch on connect")
handle_tell_change_event()