Rename replica.gc to replica.rebuild_working_set

The command-line operation is still `gc`, but we'll break that down into
finer pieces in the replica.
This commit is contained in:
Dustin J. Mitchell 2021-01-02 13:23:48 -05:00
parent da63d77d9d
commit b62370c150
4 changed files with 9 additions and 8 deletions

View file

@ -172,7 +172,7 @@ impl Replica {
/// Perform "garbage collection" on this replica. In particular, this renumbers the working
/// set to contain only pending tasks.
pub fn gc(&mut self) -> Fallible<()> {
pub fn rebuild_working_set(&mut self) -> Fallible<()> {
let pending = String::from(Status::Pending.to_taskmap());
self.taskdb
.rebuild_working_set(|t| t.get("status") == Some(&pending))?;
@ -251,7 +251,7 @@ mod tests {
assert_eq!(t.get_status(), Status::Deleted);
assert_eq!(t.get_description(), "gone");
rep.gc().unwrap();
rep.rebuild_working_set().unwrap();
assert!(rep.get_working_set_index(t.get_uuid()).unwrap().is_none());
}