mirror of
https://github.com/msfjarvis/healthchecks-rs.git
synced 2024-06-03 04:18:58 +05:30
14 lines
475 B
Rust
14 lines
475 B
Rust
use healthchecks::ping::get_client;
|
|
use std::result::Result;
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
let uuid = std::env::args()
|
|
.nth(1)
|
|
.expect("Providing a UUID as first parameter is mandatory");
|
|
let config = get_client(&uuid)?;
|
|
assert!(config.start_timer(), "Failed to start timer");
|
|
std::thread::sleep(std::time::Duration::from_millis(10_000));
|
|
assert!(config.report_success(), "Failed to report success");
|
|
Ok(())
|
|
}
|