Skip to content

Commit c52308c

Browse files
committed
bugfix: faster q
1 parent cf4539e commit c52308c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/data/poller.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,28 @@ pub fn start_poller(poll_tx: Sender<PollSnapshot>) -> PollerHandle {
108108
full
109109
}
110110
Err(_) => {
111-
thread::sleep(Duration::from_secs(1));
111+
if stop_rx.recv_timeout(Duration::from_secs(1)).is_ok() {
112+
break;
113+
}
112114
continue;
113115
}
114116
}
115117
} else {
116118
match poll_fast() {
117119
Ok(fast) => merge_cached_serve_sessions(fast, &cached_serve),
118120
Err(_) => {
119-
thread::sleep(Duration::from_secs(1));
121+
if stop_rx.recv_timeout(Duration::from_secs(1)).is_ok() {
122+
break;
123+
}
120124
continue;
121125
}
122126
}
123127
};
124128

125129
let _ = poll_tx.send(snapshot);
126-
thread::sleep(Duration::from_secs(1));
130+
if stop_rx.recv_timeout(Duration::from_secs(1)).is_ok() {
131+
break;
132+
}
127133
}
128134
});
129135

0 commit comments

Comments
 (0)