From b5d00ce19b042b9529052534132b067ff2cb50d2 Mon Sep 17 00:00:00 2001 From: Pizza <33816021+PizzaCow@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:11:58 -0600 Subject: [PATCH] fix: yield every device in SSE stream (indentation bug) --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 29fa0e6..d89c250 100644 --- a/main.py +++ b/main.py @@ -148,15 +148,14 @@ def api_scan(request: Request): count = 0 for subnet in subnets: log.info(f"Scanning subnet {subnet}") - for subnet in subnets: for device in scanner.scan_lan_stream(subnet): if "error" in device: yield f"data: {json.dumps({'type': 'error', 'message': device['error']})}\n\n" return device["type"] = "device" count += 1 - log.info(f"Device: {device.get('ip')} ({device.get('hostname')})") - yield f"data: {json.dumps(device)}\n\n" + log.info(f"Device: {device.get('ip')} ({device.get('hostname')})") + yield f"data: {json.dumps(device)}\n\n" log.info(f"Scan complete: {count} devices") yield f"data: {json.dumps({'type': 'done', 'count': count})}\n\n"