Package standalone app and automate MySQL setup
This commit is contained in:
@@ -437,11 +437,9 @@ def _restart_backend(
|
||||
log_file.write(f"\n\n===== 后端部署 {started_at},端口 {port} =====\n")
|
||||
log_file.flush()
|
||||
if os.name == "nt":
|
||||
console_runner = Path(__file__).with_name("service_console.py")
|
||||
process = popen(
|
||||
[
|
||||
sys.executable,
|
||||
str(console_runner),
|
||||
*_service_console_launcher(),
|
||||
"--title",
|
||||
f"后端服务 - 端口 {port}",
|
||||
"--log",
|
||||
@@ -488,6 +486,13 @@ def _restart_backend(
|
||||
return 1
|
||||
|
||||
|
||||
def _service_console_launcher() -> list[str]:
|
||||
if getattr(sys, "frozen", False):
|
||||
return [sys.executable, "--service-console"]
|
||||
console_runner = Path(__file__).with_name("service_console.py")
|
||||
return [sys.executable, str(console_runner)]
|
||||
|
||||
|
||||
def _restart_ssm_backend(
|
||||
command: list[str],
|
||||
cwd: Path,
|
||||
|
||||
Reference in New Issue
Block a user