enhance: ping continiously
This commit is contained in:
@@ -177,14 +177,22 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
||||
human_readable_display(preview, human_readable)?;
|
||||
}
|
||||
Commands::Ping => {
|
||||
for _ in 0..10 {
|
||||
let time = SystemTime::now();
|
||||
let decoded: PingResp =
|
||||
Sdgb1_53::request(&client, APIMethod::Ping, "", Ping {}).await?;
|
||||
match Sdgb1_53::request::<_, PingResp>(&client, APIMethod::Ping, "", Ping {}).await
|
||||
{
|
||||
Ok(decoded) => {
|
||||
info!(
|
||||
"sdgb 1.53 resp: {decoded}, {}ms",
|
||||
time.elapsed().unwrap_or_default().as_millis()
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
error!("sdgb 1.53 error: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Commands::QRLogin { ref qrcode_content } => {
|
||||
let qrcode = QRCode { qrcode_content };
|
||||
let resp = qrcode.login(&client).await;
|
||||
|
||||
Reference in New Issue
Block a user