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 {
|
||||
15 * 60 // every 15 minutes
|
||||
1 * 60 // every minute
|
||||
}
|
||||
|
||||
fn default_max_request_size() -> u32 {
|
||||
|
|
|
@ -510,10 +510,19 @@ impl Rooms {
|
|||
|
||||
for removed in statediffremoved {
|
||||
if !parent_new.remove(&removed) {
|
||||
// It was not added in the parent and we removed it
|
||||
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(
|
||||
shortstatehash,
|
||||
|
@ -557,11 +566,20 @@ impl Rooms {
|
|||
|
||||
for removed in statediffremoved {
|
||||
if !parent_new.remove(&removed) {
|
||||
// It was not added in the parent and we removed it
|
||||
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(
|
||||
shortstatehash,
|
||||
parent_new,
|
||||
|
|
Loading…
Add table
Reference in a new issue