Fix reconciliation logic
This commit is contained in:
parent
e9fd265ce6
commit
2dc9a48022
@ -75,7 +75,7 @@ impl Entry<EmptyKey, String> for Bucket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn merge(&mut self, other: &Self) {
|
fn merge(&mut self, other: &Self) {
|
||||||
if other.timestamp < self.timestamp {
|
if other.timestamp > self.timestamp {
|
||||||
*self = other.clone();
|
*self = other.clone();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,11 @@ impl Entry<EmptyKey, String> for Key {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn merge(&mut self, other: &Self) {
|
fn merge(&mut self, other: &Self) {
|
||||||
|
if other.name_timestamp > self.name_timestamp {
|
||||||
|
self.name_timestamp = other.name_timestamp;
|
||||||
|
self.name = other.name.clone();
|
||||||
|
}
|
||||||
|
|
||||||
if other.deleted {
|
if other.deleted {
|
||||||
self.deleted = true;
|
self.deleted = true;
|
||||||
}
|
}
|
||||||
@ -111,10 +116,6 @@ impl Entry<EmptyKey, String> for Key {
|
|||||||
self.authorized_buckets.clear();
|
self.authorized_buckets.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if other.name_timestamp > self.name_timestamp {
|
|
||||||
self.name_timestamp = other.name_timestamp;
|
|
||||||
self.name = other.name.clone();
|
|
||||||
}
|
|
||||||
|
|
||||||
for ab in other.authorized_buckets.iter() {
|
for ab in other.authorized_buckets.iter() {
|
||||||
match self
|
match self
|
||||||
|
Loading…
Reference in New Issue
Block a user