mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
style: 自动格式化
This commit is contained in:
@@ -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)?;
|
||||
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user