mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Initial implementation of remote library system
This commit is contained in:
1 parent
e8a53eee07
commit
e5fb0f0dbb
65 files changed
+6000
-183
No files matched your search
@@ -34,9 +34,24 @@ def _watch_parent_and_exit() -> None:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
_release_remote()
|
||||
os._exit(0)
|
||||
|
||||
|
||||
def _release_remote() -> None:
|
||||
"""Hand back a remote library's session on the way out, so the next
|
||||
computer opens it at once instead of waiting out the lease (or being asked
|
||||
to take over a laptop that has already quit). Best-effort and brief."""
|
||||
try:
|
||||
from konduktor.app_state import STATE
|
||||
|
||||
if STATE.remote is not None:
|
||||
STATE.remote.stop()
|
||||
STATE.remote.client.release(timeout=2.0)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def _free_port() -> int:
|
||||
"""Grab an unused loopback port. There's a tiny bind→close→rebind race, but
|
||||
it's harmless on 127.0.0.1 for a single local sidecar."""
|
||||
|
||||
Reference in new issue
Block a user