refactor: 统一将日志中的“Sidecar”替换为“Server”
- 将日志和错误信息中的“Sidecar”统一替换为“Server”,以更准确地反映实际启动的组件。
This commit is contained in:
@@ -54,12 +54,12 @@ pub fn spawn_sidecar(app_handle: tauri::AppHandle) {
|
|||||||
while let Some(event) = rx.recv().await {
|
while let Some(event) = rx.recv().await {
|
||||||
if let CommandEvent::Stdout(line) = event {
|
if let CommandEvent::Stdout(line) = event {
|
||||||
let output = String::from_utf8_lossy(&line);
|
let output = String::from_utf8_lossy(&line);
|
||||||
println!("Sidecar: {}", output);
|
println!("Server: {}", output);
|
||||||
|
|
||||||
// 检测服务器启动成功的标志
|
// 检测服务器启动成功的标志
|
||||||
if output.contains("Listening on:") || output.contains("localhost") {
|
if output.contains("Listening on:") || output.contains("localhost") {
|
||||||
server_ready = true;
|
server_ready = true;
|
||||||
println!("✓ Sidecar 启动成功!");
|
println!("✓ Server 启动成功!");
|
||||||
|
|
||||||
// 创建主窗口
|
// 创建主窗口
|
||||||
let url = format!("http://localhost:{}", port);
|
let url = format!("http://localhost:{}", port);
|
||||||
@@ -80,13 +80,13 @@ pub fn spawn_sidecar(app_handle: tauri::AppHandle) {
|
|||||||
|
|
||||||
// 超时检查
|
// 超时检查
|
||||||
if start_time.elapsed() > timeout {
|
if start_time.elapsed() > timeout {
|
||||||
eprintln!("✗ 启动超时:Sidecar 未能在 5 秒内启动");
|
eprintln!("✗ 启动超时:Server 未能在 5 秒内启动");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !server_ready {
|
if !server_ready {
|
||||||
eprintln!("✗ Sidecar 启动失败");
|
eprintln!("✗ Server 启动失败");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user