mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-11-16 15:27:46 +00:00
feat: better error output if request for xmrig fail
This commit is contained in:
parent
307a8b5dba
commit
e9d8d37ad2
1 changed files with 12 additions and 11 deletions
|
@ -617,17 +617,18 @@ impl Helper {
|
|||
);
|
||||
// Send an HTTP API request
|
||||
debug!("XMRig Watchdog | Attempting HTTP API request...");
|
||||
if let Ok(priv_api) =
|
||||
PrivXmrigApi::request_xmrig_api(client.clone(), &api_uri, token).await
|
||||
{
|
||||
match PrivXmrigApi::request_xmrig_api(client.clone(), &api_uri, token).await {
|
||||
Ok(priv_api) => {
|
||||
debug!("XMRig Watchdog | HTTP API request OK, attempting [update_from_priv()]");
|
||||
PubXmrigApi::update_from_priv(&pub_api, priv_api);
|
||||
} else {
|
||||
}
|
||||
Err(err) => {
|
||||
warn!(
|
||||
"XMRig Watchdog | Could not send HTTP API request to: {}",
|
||||
api_uri
|
||||
"XMRig Watchdog | Could not send HTTP API request to: {}\n{}",
|
||||
api_uri, err
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Sleep (only if 900ms hasn't passed)
|
||||
let elapsed = now.elapsed().as_millis();
|
||||
|
@ -811,7 +812,7 @@ impl PrivXmrigApi {
|
|||
.uri(api_uri)
|
||||
.body(hyper::Body::empty())?;
|
||||
let response = tokio::time::timeout(
|
||||
std::time::Duration::from_millis(500),
|
||||
std::time::Duration::from_millis(5000),
|
||||
client.request(request),
|
||||
)
|
||||
.await?;
|
||||
|
|
Loading…
Reference in a new issue