mirror of
https://github.com/mikedilger/chorus.git
synced 2026-06-02 07:02:09 +00:00
Fix runaway tokio wastage
This commit is contained in:
parent
254c0a9afc
commit
280e9a90a6
@ -343,10 +343,11 @@ impl WebSocketService {
|
||||
|
||||
let mut last_message_at = Instant::now();
|
||||
|
||||
loop {
|
||||
let interval = tokio::time::interval(Duration::from_secs(5));
|
||||
tokio::pin!(interval);
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(5));
|
||||
let _ = interval.tick().await; // consume the first tick
|
||||
tokio::pin!(interval);
|
||||
|
||||
loop {
|
||||
tokio::select! {
|
||||
instant = interval.tick() => {
|
||||
// Drop them if they have no subscriptions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user