Phase 2.2: performance optimizations, debug tools, app close fix
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
"""Entry point for PyInstaller bundle"""
|
||||
print("[RFCP] run_server.py starting...", flush=True)
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Force unbuffered stdout/stderr — critical for piped output (Electron, bat files)
|
||||
os.environ['PYTHONUNBUFFERED'] = '1'
|
||||
if hasattr(sys.stdout, 'reconfigure'):
|
||||
try:
|
||||
sys.stdout.reconfigure(line_buffering=True)
|
||||
except Exception:
|
||||
pass
|
||||
if hasattr(sys.stderr, 'reconfigure'):
|
||||
try:
|
||||
sys.stderr.reconfigure(line_buffering=True)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
print("[RFCP] run_server.py starting...", flush=True)
|
||||
|
||||
# Set base path for PyInstaller
|
||||
if getattr(sys, 'frozen', False):
|
||||
base_dir = os.path.dirname(sys.executable)
|
||||
|
||||
Reference in New Issue
Block a user