Time and metadata improvements

This commit is contained in:
Alex Auvolat
2021-03-15 16:21:41 +01:00
parent 097c339d98
commit 3bf2df622a
16 changed files with 111 additions and 44 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use garage_util::data::now_msec;
use garage_util::time::now_msec;
use crate::crdt::crdt::*;
+1 -1
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use garage_util::data::now_msec;
use garage_util::time::now_msec;
use crate::crdt::crdt::*;
+6 -4
View File
@@ -75,17 +75,19 @@ where
match self.gc_loop_iter().await {
Ok(true) => {
// Stuff was done, loop imediately
continue;
}
Ok(false) => {
select! {
_ = tokio::time::delay_for(Duration::from_secs(10)).fuse() => (),
_ = must_exit.recv().fuse() => (),
}
// Nothing was done, sleep for some time (below)
}
Err(e) => {
warn!("({}) Error doing GC: {}", self.data.name, e);
}
}
select! {
_ = tokio::time::delay_for(Duration::from_secs(10)).fuse() => (),
_ = must_exit.recv().fuse() => (),
}
}
Ok(())
}