mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-04 17:48:52 +01:00
fix: delta calculation
This commit is contained in:
parent
3cf0145bc5
commit
38effda799
2 changed files with 21 additions and 3 deletions
|
@ -108,7 +108,7 @@ fn default_db_cache_capacity_mb() -> f64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_sqlite_wal_clean_second_interval() -> u32 {
|
fn default_sqlite_wal_clean_second_interval() -> u32 {
|
||||||
15 * 60 // every 15 minutes
|
1 * 60 // every minute
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_max_request_size() -> u32 {
|
fn default_max_request_size() -> u32 {
|
||||||
|
|
|
@ -510,10 +510,19 @@ impl Rooms {
|
||||||
|
|
||||||
for removed in statediffremoved {
|
for removed in statediffremoved {
|
||||||
if !parent_new.remove(&removed) {
|
if !parent_new.remove(&removed) {
|
||||||
|
// It was not added in the parent and we removed it
|
||||||
parent_removed.insert(removed);
|
parent_removed.insert(removed);
|
||||||
}
|
}
|
||||||
|
// Else it was added in the parent and we removed it again. We can forget this change
|
||||||
|
}
|
||||||
|
|
||||||
|
for new in statediffnew {
|
||||||
|
if !parent_removed.remove(&new) {
|
||||||
|
// It was not touched in the parent and we added it
|
||||||
|
parent_new.insert(new);
|
||||||
|
}
|
||||||
|
// Else it was removed in the parent and we added it again. We can forget this change
|
||||||
}
|
}
|
||||||
parent_new.extend(statediffnew);
|
|
||||||
|
|
||||||
self.save_state_from_diff(
|
self.save_state_from_diff(
|
||||||
shortstatehash,
|
shortstatehash,
|
||||||
|
@ -557,11 +566,20 @@ impl Rooms {
|
||||||
|
|
||||||
for removed in statediffremoved {
|
for removed in statediffremoved {
|
||||||
if !parent_new.remove(&removed) {
|
if !parent_new.remove(&removed) {
|
||||||
|
// It was not added in the parent and we removed it
|
||||||
parent_removed.insert(removed);
|
parent_removed.insert(removed);
|
||||||
}
|
}
|
||||||
|
// Else it was added in the parent and we removed it again. We can forget this change
|
||||||
|
}
|
||||||
|
|
||||||
|
for new in statediffnew {
|
||||||
|
if !parent_removed.remove(&new) {
|
||||||
|
// It was not touched in the parent and we added it
|
||||||
|
parent_new.insert(new);
|
||||||
|
}
|
||||||
|
// Else it was removed in the parent and we added it again. We can forget this change
|
||||||
}
|
}
|
||||||
|
|
||||||
parent_new.extend(statediffnew);
|
|
||||||
self.save_state_from_diff(
|
self.save_state_from_diff(
|
||||||
shortstatehash,
|
shortstatehash,
|
||||||
parent_new,
|
parent_new,
|
||||||
|
|
Loading…
Reference in a new issue