Compare commits

...

1 Commits

Author SHA1 Message Date
daniel156161 08d0d154c9 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.
2026-07-27 22:51:03 +02:00
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() flag.notify()
except Exception as exc: except Exception as exc:
if not stop.is_set(): 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) stop.wait(30)
finally: finally:
if client: if client:
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "nanoshare-cli" name = "nanoshare-cli"
version = "0.4.0" version = "0.4.1"
description = "NanoShare desktop CLI and folder sync client" description = "NanoShare desktop CLI and folder sync client"
readme = "README.md" readme = "README.md"
requires-python = ">=3.11" requires-python = ">=3.11"
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "nanoshare" name = "nanoshare"
version = "1.25.0" version = "1.26.0"
description = "Add your description here" description = "Add your description here"
readme = "README.md" readme = "README.md"
requires-python = ">=3.13" requires-python = ">=3.13"
+4 -2
View File
@@ -37,7 +37,7 @@ async def api_file_events(user: dict):
previous = await _snapshot(user_id) previous = await _snapshot(user_id)
yield 'event: ready\ndata: {}\n\n' yield 'event: ready\ndata: {}\n\n'
while True: while True:
await asyncio.sleep(30) await asyncio.sleep(15)
current = await _snapshot(user_id) current = await _snapshot(user_id)
if current != previous: if current != previous:
previous = current previous = current
@@ -45,7 +45,9 @@ async def api_file_events(user: dict):
else: else:
yield ': keepalive\n\n' 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', 'Cache-Control': 'no-cache',
'X-Accel-Buffering': 'no', 'X-Accel-Buffering': 'no',
}) })
response.timeout = None
return response
Generated
+1 -1
View File
@@ -720,7 +720,7 @@ wheels = [
[[package]] [[package]]
name = "nanoshare" name = "nanoshare"
version = "1.25.0" version = "1.26.0"
source = { virtual = "." } source = { virtual = "." }
dependencies = [ dependencies = [
{ name = "aiohttp" }, { name = "aiohttp" },