diff --git a/cli/nanoshare_client/watch.py b/cli/nanoshare_client/watch.py index c51bc1d..5d088d8 100644 --- a/cli/nanoshare_client/watch.py +++ b/cli/nanoshare_client/watch.py @@ -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: diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 399901b..738f08a 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -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" diff --git a/pyproject.toml b/pyproject.toml index d90e35f..afd2891 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/routes/api/events.py b/routes/api/events.py index 8297ce4..3bb4fce 100644 --- a/routes/api/events.py +++ b/routes/api/events.py @@ -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 diff --git a/uv.lock b/uv.lock index 93c9a14..d16331c 100644 --- a/uv.lock +++ b/uv.lock @@ -720,7 +720,7 @@ wheels = [ [[package]] name = "nanoshare" -version = "1.25.0" +version = "1.26.0" source = { virtual = "." } dependencies = [ { name = "aiohttp" },