diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-25 14:01:51 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-25 14:01:51 +0000 |
| commit | ca86c0c3a754374f269e51406f312b45874a28fb (patch) | |
| tree | 4854c86733cbcced909ae4ad24b81a15d0c9105d /grasp-audit/src/bin | |
| parent | 6007647e37344bcc3e8ade6500ed5dbb11d302e0 (diff) | |
report partial results on overall timeout: completed checks pass/fail, timed-out step marked, remaining skipped
Diffstat (limited to 'grasp-audit/src/bin')
| -rw-r--r-- | grasp-audit/src/bin/grasp-audit.rs | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/grasp-audit/src/bin/grasp-audit.rs b/grasp-audit/src/bin/grasp-audit.rs index f56fc44..9bd7826 100644 --- a/grasp-audit/src/bin/grasp-audit.rs +++ b/grasp-audit/src/bin/grasp-audit.rs | |||
| @@ -115,18 +115,10 @@ async fn main() -> Result<()> { | |||
| 115 | if !json { | 115 | if !json { |
| 116 | println!("\n[Run {}]", run); | 116 | println!("\n[Run {}]", run); |
| 117 | } | 117 | } |
| 118 | let start = std::time::Instant::now(); | 118 | let report = grasp_audit::probe::run_probe( |
| 119 | let report = tokio::time::timeout( | 119 | &relay, keys.clone(), read_only, timeout, overall_secs, |
| 120 | Duration::from_secs(overall_secs), | ||
| 121 | grasp_audit::probe::run_probe(&relay, keys.clone(), read_only, timeout), | ||
| 122 | ) | 120 | ) |
| 123 | .await | 121 | .await; |
| 124 | .unwrap_or_else(|_| { | ||
| 125 | grasp_audit::probe::ProbeReport::overall_timeout( | ||
| 126 | &relay, | ||
| 127 | start.elapsed().as_millis() as u64, | ||
| 128 | ) | ||
| 129 | }); | ||
| 130 | if json { | 122 | if json { |
| 131 | report.print_json(); | 123 | report.print_json(); |
| 132 | } else { | 124 | } else { |
| @@ -136,18 +128,10 @@ async fn main() -> Result<()> { | |||
| 136 | tokio::time::sleep(Duration::from_secs(interval)).await; | 128 | tokio::time::sleep(Duration::from_secs(interval)).await; |
| 137 | } | 129 | } |
| 138 | } else { | 130 | } else { |
| 139 | let start = std::time::Instant::now(); | 131 | let report = grasp_audit::probe::run_probe( |
| 140 | let report = tokio::time::timeout( | 132 | &relay, keys, read_only, timeout, overall_secs, |
| 141 | Duration::from_secs(overall_secs), | ||
| 142 | grasp_audit::probe::run_probe(&relay, keys, read_only, timeout), | ||
| 143 | ) | 133 | ) |
| 144 | .await | 134 | .await; |
| 145 | .unwrap_or_else(|_| { | ||
| 146 | grasp_audit::probe::ProbeReport::overall_timeout( | ||
| 147 | &relay, | ||
| 148 | start.elapsed().as_millis() as u64, | ||
| 149 | ) | ||
| 150 | }); | ||
| 151 | if json { | 135 | if json { |
| 152 | report.print_json(); | 136 | report.print_json(); |
| 153 | } else { | 137 | } else { |