Some improvements in background worker but we terminate late

This commit is contained in:
Alex Auvolat
2021-03-15 23:14:12 +01:00
parent 0cd5b2ae19
commit 6a8439fd13
14 changed files with 169 additions and 148 deletions
+1 -4
View File
@@ -101,10 +101,7 @@ impl MerkleUpdater {
ret
}
async fn updater_loop(
self: Arc<Self>,
mut must_exit: watch::Receiver<bool>,
) {
async fn updater_loop(self: Arc<Self>, mut must_exit: watch::Receiver<bool>) {
while !*must_exit.borrow() {
if let Some(x) = self.todo.iter().next() {
match x {
+1 -1
View File
@@ -3,7 +3,7 @@ use std::convert::TryInto;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
use futures::{select};
use futures::select;
use futures_util::future::*;
use futures_util::stream::*;
use rand::Rng;