Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling #52

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cargo install wait-for-them
wait-for-them host1:port1 host2:port2 http://host3:8080/
```

### Wait with timeout (in miliseconds)
### Wait with timeout (in milliseconds)
```
wait-for-them -t 5000 host1:port1 host2:port2 http://host3:8080/
```
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static DOMAIN_REGEX: &str =
/// ```
#[derive(Debug, PartialEq, Clone)]
pub enum ToCheck {
/// Hostname or IP addess e.g. `127.0.0.1:8080` or `localhost:80`
/// Hostname or IP address e.g. `127.0.0.1:8080` or `localhost:80`
HostnameAndPort(String, u16),

#[cfg(feature = "http")]
Expand Down Expand Up @@ -131,7 +131,7 @@ impl std::str::FromStr for ToCheck {
/// * `hosts_ports_or_http_urls` - items to be check
/// * `timeout` - `None` means that it it may wait forever or `Some(..)` set timeout in milis
/// * `start_time` - Optional time_tracker
/// * `silent` - supresses output to console if true
/// * `silent` - suppresses output to console if true
///
/// # Returns
/// `Vec` with `Option` - `Some(..)` with elapsed time in milis on success `None` otherwise.
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn print_help(error: Option<String>) {
"{}Usage:
{}
-s | --silent don't display any output
-t TIMEOUT | --timeout TIMEOUT in miliseconds
-t TIMEOUT | --timeout TIMEOUT in milliseconds
Wait till all links are verified

wait-for-them -h | --help
Expand Down
14 changes: 7 additions & 7 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ use std::{
};

pub struct TestServer {
exitting: Arc<AtomicBool>,
exiting: Arc<AtomicBool>,
}

impl TestServer {
pub fn new(port: u16, timeout: Duration) -> Self {
let exitting = Arc::new(AtomicBool::new(false));
let exitting_cloned = exitting.clone();
let exiting = Arc::new(AtomicBool::new(false));
let exiting_cloned = exiting.clone();
thread::spawn(move || {
let exitting = exitting_cloned;
let exiting = exiting_cloned;
thread::sleep(timeout);
let listener = TcpListener::bind(format!("127.0.0.1:{}", port)).expect("can't connect");
listener
Expand Down Expand Up @@ -47,17 +47,17 @@ OK
}
Err(_) => {}
}
if exitting.as_ref().load(Ordering::Relaxed) {
if exiting.as_ref().load(Ordering::Relaxed) {
break;
}
}
});
Self { exitting }
Self { exiting }
}
}

impl Drop for TestServer {
fn drop(&mut self) {
self.exitting.store(true, Ordering::Relaxed);
self.exiting.store(true, Ordering::Relaxed);
}
}