fix(api): keep file event streams alive
Build and Push Docker Container / build-and-push (push) Successful in 2m7s

- Disable the Quart response timeout for authenticated file event streams.
- Send SSE keepalives more often to avoid idle proxy disconnects.
- Treat remote stream interruptions as reconnectable disconnects in watch output.
- Bump NanoShare to 1.26.0 and the standalone CLI to 0.4.1.
This commit is contained in:
2026-07-27 22:51:03 +02:00
parent d3c914285c
commit 08d0d154c9
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ def _remote_events_thread(args, flag: _ChangeFlag, stop: threading.Event) -> thr
flag.notify()
except Exception as exc:
if not stop.is_set():
print(f'remote event stream unavailable; retrying in 30s: {exc}', file=sys.stderr)
print(f'remote event stream disconnected; retrying in 30s: {exc}', file=sys.stderr)
stop.wait(30)
finally:
if client:
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "nanoshare-cli"
version = "0.4.0"
version = "0.4.1"
description = "NanoShare desktop CLI and folder sync client"
readme = "README.md"
requires-python = ">=3.11"
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "nanoshare"
version = "1.25.0"
version = "1.26.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
+4 -2
View File
@@ -37,7 +37,7 @@ async def api_file_events(user: dict):
previous = await _snapshot(user_id)
yield 'event: ready\ndata: {}\n\n'
while True:
await asyncio.sleep(30)
await asyncio.sleep(15)
current = await _snapshot(user_id)
if current != previous:
previous = current
@@ -45,7 +45,9 @@ async def api_file_events(user: dict):
else:
yield ': keepalive\n\n'
return Response(stream(), content_type='text/event-stream', headers={
response = Response(stream(), content_type='text/event-stream', headers={
'Cache-Control': 'no-cache',
'X-Accel-Buffering': 'no',
})
response.timeout = None
return response
Generated
+1 -1
View File
@@ -720,7 +720,7 @@ wheels = [
[[package]]
name = "nanoshare"
version = "1.25.0"
version = "1.26.0"
source = { virtual = "." }
dependencies = [
{ name = "aiohttp" },