File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,14 @@ fn main_thread(
65
65
let mut file_opened = false ;
66
66
67
67
loop {
68
- if let Ok ( cl) = clear_rx. recv_timeout ( Duration :: from_millis ( 1 ) ) {
68
+ if let Ok ( cl) = clear_rx. try_recv ( ) {
69
69
if cl {
70
70
data = DataContainer :: default ( ) ;
71
71
failed_format_counter = 0 ;
72
72
}
73
73
}
74
74
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 ( ) {
76
76
data. loaded_from_file = false ;
77
77
if !packet. payload . is_empty ( ) {
78
78
sync_tx. send ( true ) . expect ( "unable to send sync tx" ) ;
@@ -104,7 +104,7 @@ fn main_thread(
104
104
}
105
105
}
106
106
}
107
- if let Ok ( fp) = load_rx. recv_timeout ( Duration :: from_millis ( 10 ) ) {
107
+ if let Ok ( fp) = load_rx. try_recv ( ) {
108
108
if let Some ( file_ending) = fp. extension ( ) {
109
109
match file_ending. to_str ( ) . unwrap ( ) {
110
110
"csv" => {
@@ -145,7 +145,7 @@ fn main_thread(
145
145
* write_guard = data. clone ( ) ;
146
146
}
147
147
148
- if let Ok ( csv_options) = save_rx. recv_timeout ( Duration :: from_millis ( 1 ) ) {
148
+ if let Ok ( csv_options) = save_rx. try_recv ( ) {
149
149
match save_to_csv ( & data, & csv_options) {
150
150
Ok ( _) => {
151
151
log:: info!( "saved data file to {:?} " , csv_options. file_path) ;
You can’t perform that action at this time.
0 commit comments