actually purge old current-dependents

This commit is contained in:
Aiden McClelland
2022-07-01 16:05:59 -06:00
parent cb9c01d94b
commit b580f549a6
2 changed files with 7 additions and 2 deletions

View File

@@ -624,10 +624,15 @@ pub fn configure_rec<'a, Db: DbHandle>(
}; };
// update dependencies // update dependencies
let prev_current_dependencies = receipts
.current_dependencies
.get(db, &id)
.await?
.unwrap_or_default();
remove_from_current_dependents_lists( remove_from_current_dependents_lists(
db, db,
id, id,
&current_dependencies, &prev_current_dependencies,
&receipts.current_dependents, &receipts.current_dependents,
) )
.await?; // remove previous .await?; // remove previous

View File

@@ -302,7 +302,7 @@ impl HasModel for CurrentDependents {
type Model = MapModel<Self>; type Model = MapModel<Self>;
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone, Default, Deserialize, Serialize)]
pub struct CurrentDependencies(pub BTreeMap<PackageId, CurrentDependencyInfo>); pub struct CurrentDependencies(pub BTreeMap<PackageId, CurrentDependencyInfo>);
impl CurrentDependencies { impl CurrentDependencies {
pub fn map( pub fn map(