style: 自动格式化

This commit is contained in:
2026-10-11 16:49:07 +00:00
parent 06527852a5
commit 9af43fbeb3
2 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -96,7 +96,9 @@ pub fn send_control_request_from(sidecar_path: &Path, request: &ServerRequest) -
///
/// # 副作用
/// - 建立并关闭一条连接(Unix socket 或 TCP)。
pub fn send_control_request_at(endpoint: &Endpoint, token: &str, request: &ServerRequest) -> Result<ServerResponse, ClientError> {
pub fn send_control_request_at(
endpoint: &Endpoint, token: &str, request: &ServerRequest,
) -> Result<ServerResponse, ClientError> {
// 连接:5 秒超时是安全网,本地连接立即完成或立即失败。
let stream = connect_with_timeout(endpoint, CONNECT_TIMEOUT)?;
+6 -4
View File
@@ -83,10 +83,12 @@ pub fn wait_server_ready(deadline: Duration) -> Result<(), String> {
/// - 每轮建立并关闭一条连接(Unix socket 或 TCP)。
pub fn wait_server_ready_remote(endpoint: &Endpoint, token: &str, deadline: Duration) -> Result<(), String> {
wait_ready_until(
|| matches!(
send_control_request_at(endpoint, token, &ServerRequest::Health),
Ok(ServerResponse::Health { healthy: true })
),
|| {
matches!(
send_control_request_at(endpoint, token, &ServerRequest::Health),
Ok(ServerResponse::Health { healthy: true })
)
},
deadline,
)
}