INNER CODE UNIT · Python
has_live_thread
NextWeb4/lan-file-transfer · lan_transfer/server.py:29
def has_live_thread(self) -> bool:
return bool(self._thread and self._thread.is_alive())
def start(self) -> None:
if self._thread and self._thread.is_alive():
return
app = create_app(self.config, self.storage)
uvicorn_config = uvicorn.Config(
app,
host=self.config.host,
port=self.config.port,
log_level="info",
access_log=True,
log_config=None,
)
self._server = uvicorn.Server(uvicorn_config)
self._thread = threading.Thread(target=self._run, name="LANTransferHTTP", daemon=True)