Skip to content

Commit

Permalink
fix hangin issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Oct 17, 2024
1 parent 5ffecbf commit bd1ed39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion oryx-tui/src/handler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{thread, time::Duration};
use std::{
thread::{self, sleep},
time::Duration,
};

use crate::{
app::{ActivePopup, App, AppResult},
Expand All @@ -25,6 +28,7 @@ pub fn handle_key_events(
app.filter
.start(event_sender.clone(), app.data_channel_sender.clone())?;

sleep(Duration::from_millis(100));
app.start_sniffing = true;
}
}
Expand Down
5 changes: 3 additions & 2 deletions oryx-tui/src/section/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ impl Stats {
move || {
let mut last_index = 0;
loop {
thread::sleep(Duration::from_millis(160));
let packets = packets.lock().unwrap();
thread::sleep(Duration::from_millis(500));

let packets = { packets.lock().unwrap().clone() };

if packets.is_empty() {
continue;
Expand Down

0 comments on commit bd1ed39

Please sign in to comment.