Fix uvicorn logging for PyInstaller, update gitignore
This commit is contained in:
14
.gitignore
vendored
14
.gitignore
vendored
@@ -9,3 +9,17 @@ backend/venv/
|
|||||||
backend/data/
|
backend/data/
|
||||||
.claude/
|
.claude/
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
|
|
||||||
|
# Desktop build artifacts
|
||||||
|
desktop/backend-dist/
|
||||||
|
desktop/dist/
|
||||||
|
desktop/node_modules/
|
||||||
|
|
||||||
|
# Installer build artifacts
|
||||||
|
installer/build/
|
||||||
|
installer/dist/
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
*.spec.bak
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|||||||
@@ -4,8 +4,14 @@ import sys
|
|||||||
|
|
||||||
# Set base path for PyInstaller
|
# Set base path for PyInstaller
|
||||||
if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
# Running as compiled
|
|
||||||
os.chdir(os.path.dirname(sys.executable))
|
os.chdir(os.path.dirname(sys.executable))
|
||||||
|
# Fix uvicorn TTY detection — sys.stdin/stdout/stderr are None when frozen
|
||||||
|
if sys.stdin is None:
|
||||||
|
sys.stdin = open(os.devnull, 'r')
|
||||||
|
if sys.stdout is None:
|
||||||
|
sys.stdout = open(os.devnull, 'w')
|
||||||
|
if sys.stderr is None:
|
||||||
|
sys.stderr = open(os.devnull, 'w')
|
||||||
|
|
||||||
import uvicorn
|
import uvicorn
|
||||||
from app.main import app
|
from app.main import app
|
||||||
@@ -18,5 +24,6 @@ if __name__ == '__main__':
|
|||||||
app,
|
app,
|
||||||
host=host,
|
host=host,
|
||||||
port=port,
|
port=port,
|
||||||
log_level='info',
|
log_level='warning',
|
||||||
|
access_log=False,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user