Streamline SSE client setup in tellupdater by removing redundant HTTP stream handling
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user