add num_local_operations to Replica

This commit is contained in:
Dustin J. Mitchell
2022-04-23 18:51:40 +00:00
parent 6f8c734186
commit fd504b7d66
5 changed files with 30 additions and 0 deletions

View File

@@ -254,6 +254,11 @@ impl Replica {
}
Ok(())
}
/// Get the number of operations local to this replica and not yet synchronized to the server.
pub fn num_local_operations(&mut self) -> anyhow::Result<usize> {
self.taskdb.num_operations()
}
}
#[cfg(test)]
@@ -399,6 +404,8 @@ mod tests {
},
]
);
assert_eq!(rep.num_local_operations().unwrap(), 10);
}
#[test]