Skip to content

Commit

Permalink
Merge pull request #8 from jasonmccampbell/dep-update
Browse files Browse the repository at this point in the history
Updated to Tokio 1.1 and other dependencies
  • Loading branch information
jasonmccampbell authored Jan 25, 2021
2 parents 4a6dac4 + 5e1e6e3 commit a33812d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 70 deletions.
119 changes: 55 additions & 64 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ edition = "2018"
[dependencies]
bincode = "1"
byteorder = "1"
bytes = "0.6"
bytes = "^1"
clap = "2"
get_if_addrs = "0.5"
gethostname = "0"
home = "0.5"
lazy_static = "1"
serde = { version = "1", features = ["derive"] }
simple-process-stats = "0.2"
simple-process-stats = "^1"
tempdir = "0.3"
# TODO: Reduce feature set
tokio = { version = "0.3", features = ["full"] }
tokio = { version = "^1.1", features = ["full"] }
toml = "0.5"
ubyte = { path = "../ubyte" }
which = "2"
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub async fn run(max_cpus: Option<usize>, alt_start_cmd: bool) -> Result<(), Box
let (inbound_tx, mut inbound_rx) = mpsc::channel::<(usize, Box<ipc::Message>)>(256);

// Make sure we check on things even if no clients are communicating
let mut watchdog = tokio::time::sleep(Duration::from_secs(5));
let mut watchdog = Box::pin(tokio::time::sleep(Duration::from_secs(5)));

// Server state includes the user configuration from .spraycc, plus overrides
let mut server_state = ServerState::new(callme, max_cpus, alt_start_cmd);
Expand Down Expand Up @@ -352,11 +352,11 @@ pub async fn run(max_cpus: Option<usize>, alt_start_cmd: bool) -> Result<(), Box
}
server_state.activity_occurred();
}
_ = &mut watchdog => {
_ = &mut watchdog, if !watchdog.is_elapsed() => {
server_state.update().await?;
server_state.report_status(5);
server_state.bytes_this_period = ByteUnit::Byte(0);
watchdog = tokio::time::sleep(Duration::from_secs(5));
watchdog = Box::pin(tokio::time::sleep(Duration::from_secs(5)));
}
}

Expand Down

0 comments on commit a33812d

Please sign in to comment.