aboutsummaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-15 16:21:41 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-15 16:21:41 +0100
commit3bf2df622a070fe8f233bec6d60bd5cca995fbfc (patch)
tree65ba71d4b950208c177a96ba34b797f18e732d5b /src/table
parent097c339d981dba0420af17d30d1221181d8bf1d7 (diff)
downloadgarage-3bf2df622a070fe8f233bec6d60bd5cca995fbfc.tar.gz
garage-3bf2df622a070fe8f233bec6d60bd5cca995fbfc.zip
Time and metadata improvements
Diffstat (limited to 'src/table')
-rw-r--r--src/table/crdt/lww.rs2
-rw-r--r--src/table/crdt/lww_map.rs2
-rw-r--r--src/table/gc.rs10
3 files changed, 8 insertions, 6 deletions
diff --git a/src/table/crdt/lww.rs b/src/table/crdt/lww.rs
index 9a3ab671..25ecdb07 100644
--- a/src/table/crdt/lww.rs
+++ b/src/table/crdt/lww.rs
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
-use garage_util::data::now_msec;
+use garage_util::time::now_msec;
use crate::crdt::crdt::*;
diff --git a/src/table/crdt/lww_map.rs b/src/table/crdt/lww_map.rs
index bd40f368..7b372191 100644
--- a/src/table/crdt/lww_map.rs
+++ b/src/table/crdt/lww_map.rs
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
-use garage_util::data::now_msec;
+use garage_util::time::now_msec;
use crate::crdt::crdt::*;
diff --git a/src/table/gc.rs b/src/table/gc.rs
index 5b7f1ee7..c13c8234 100644
--- a/src/table/gc.rs
+++ b/src/table/gc.rs
@@ -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(())
}