Compare commits
1 Commits
d3c914285c
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
08d0d154c9
|
@@ -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
@@ -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
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user