Skip to content

Commit cffa706

Browse files
committed
remove timeouts
1 parent 6f0d362 commit cffa706

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ fn main_thread(
6565
let mut file_opened = false;
6666

6767
loop {
68-
if let Ok(cl) = clear_rx.recv_timeout(Duration::from_millis(1)) {
68+
if let Ok(cl) = clear_rx.try_recv() {
6969
if cl {
7070
data = DataContainer::default();
7171
failed_format_counter = 0;
7272
}
7373
}
7474
if !file_opened {
75-
if let Ok(packet) = raw_data_rx.recv_timeout(Duration::from_millis(1)) {
75+
if let Ok(packet) = raw_data_rx.try_recv() {
7676
data.loaded_from_file = false;
7777
if !packet.payload.is_empty() {
7878
sync_tx.send(true).expect("unable to send sync tx");
@@ -104,7 +104,7 @@ fn main_thread(
104104
}
105105
}
106106
}
107-
if let Ok(fp) = load_rx.recv_timeout(Duration::from_millis(10)) {
107+
if let Ok(fp) = load_rx.try_recv() {
108108
if let Some(file_ending) = fp.extension() {
109109
match file_ending.to_str().unwrap() {
110110
"csv" => {
@@ -145,7 +145,7 @@ fn main_thread(
145145
*write_guard = data.clone();
146146
}
147147

148-
if let Ok(csv_options) = save_rx.recv_timeout(Duration::from_millis(1)) {
148+
if let Ok(csv_options) = save_rx.try_recv() {
149149
match save_to_csv(&data, &csv_options) {
150150
Ok(_) => {
151151
log::info!("saved data file to {:?} ", csv_options.file_path);

0 commit comments

Comments
 (0)