mirror of https://github.com/dswd/zvault
Fixed index inconsistency when removing gone bundle
This commit is contained in:
parent
d5b033c85a
commit
df2f407d96
|
@ -228,6 +228,7 @@ impl Repository {
|
||||||
fn remove_gone_remote_bundle(&mut self, bundle: BundleInfo) -> Result<(), RepositoryError> {
|
fn remove_gone_remote_bundle(&mut self, bundle: BundleInfo) -> Result<(), RepositoryError> {
|
||||||
if let Some(id) = self.bundle_map.find(&bundle.id) {
|
if let Some(id) = self.bundle_map.find(&bundle.id) {
|
||||||
info!("Removing bundle from index: {}", bundle.id);
|
info!("Removing bundle from index: {}", bundle.id);
|
||||||
|
try!(self.index.filter(|_key, data| data.bundle != id));
|
||||||
self.bundle_map.remove(id);
|
self.bundle_map.remove(id);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in New Issue