Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d55dc4a268 |
+6
-1
@@ -153,8 +153,13 @@ def serve_in_thread(port: int | None = None) -> threading.Thread:
|
||||
import uvicorn
|
||||
|
||||
p = port or cfgmod.DEFAULT_PORT
|
||||
# log_config=None disables uvicorn's default dictConfig. In the frozen,
|
||||
# windowed exe there is no console, so sys.stderr is None and uvicorn's
|
||||
# default logging setup dies with "Unable to configure formatter 'default'",
|
||||
# taking the whole control-panel server down. We don't need uvicorn's logs
|
||||
# (the daemon has its own file logger), so skip its logging config entirely.
|
||||
server = uvicorn.Server(uvicorn.Config(
|
||||
app, host="127.0.0.1", port=p, log_level="warning"))
|
||||
app, host="127.0.0.1", port=p, log_level="warning", log_config=None))
|
||||
t = threading.Thread(target=server.run, daemon=True, name="clawd-http")
|
||||
t.start()
|
||||
return t
|
||||
|
||||
Reference in New Issue
Block a user