fix(pusher): log send_stats_report errors instead of discarding
main_result called send_stats_report/calculate_stats with 'let _ = ...', silently dropping any failure. A broken welist route (e.g. unreachable IPv4 path) is then invisible in the logs and can go unnoticed for a long time. Log failures with warn! so connectivity problems are diagnosable.
This commit is contained in:
@@ -333,8 +333,14 @@ async fn main_result(cfg: &MyConfig, network_params: &NetworkParams) -> Result<(
|
|||||||
stmt.bind((2, Value::String(txid.clone()))).unwrap();
|
stmt.bind((2, Value::String(txid.clone()))).unwrap();
|
||||||
let _ = stmt.next();
|
let _ = stmt.next();
|
||||||
}
|
}
|
||||||
let _ = send_stats_report(cfg, bcinfo).await;
|
if let Err(e) = send_stats_report(cfg, bcinfo).await {
|
||||||
let _ = calculate_stats(&db, network_params.db_field.clone()).await;
|
// Never discard silently: a failing report is otherwise
|
||||||
|
// invisible in the logs and can go unnoticed for a long time.
|
||||||
|
warn!("send_stats_report failed: {e}");
|
||||||
|
}
|
||||||
|
if let Err(e) = calculate_stats(&db, network_params.db_field.clone()).await {
|
||||||
|
warn!("calculate_stats failed: {e}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(erx) => {
|
Err(erx) => {
|
||||||
error!("impossible to get client: {}, retrying on next block", erx);
|
error!("impossible to get client: {}, retrying on next block", erx);
|
||||||
|
|||||||
Reference in New Issue
Block a user