Skip to content

Commit

Permalink
fix: remove get_status_interval
Browse files Browse the repository at this point in the history
Because it affets the `--interval` parameter of the `watch` command.
  • Loading branch information
therustmonk committed Mar 22, 2022
1 parent 44bf708 commit 3ccea96
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions applications/tari_base_node/src/commands/cli_loop.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
io,
time::{Duration, Instant},
};
use std::{io, time::Duration};

use crossterm::{
cursor,
Expand Down Expand Up @@ -114,7 +111,6 @@ impl CliLoop {

async fn watch_loop(&mut self) {
if let Some(command) = self.watch_task.take() {
let start_time = Instant::now();
let mut interrupt = signal::ctrl_c().fuse().boxed();
let mut software_update_notif = self.context.software_updater.new_update_notifier().clone();
let config = self.context.config.clone();
Expand All @@ -129,7 +125,7 @@ impl CliLoop {
let mut events = EventStream::new();
loop {
terminal::enable_raw_mode().ok();
let interval = get_status_interval(start_time, interval);
let interval = time::sleep(interval);
tokio::select! {
_ = interval => {
terminal::disable_raw_mode().ok();
Expand Down Expand Up @@ -219,11 +215,3 @@ impl CliLoop {
}
}
}

fn get_status_interval(start_time: Instant, long_interval: Duration) -> time::Sleep {
let duration = match start_time.elapsed().as_secs() {
0..=120 => Duration::from_secs(5),
_ => long_interval,
};
time::sleep(duration)
}

0 comments on commit 3ccea96

Please sign in to comment.