node: Preserve tracking policy on startup

We were needlessly overwriting the policy if it was set to "trusted".
This commit is contained in:
Alexis Sellier 2023-04-19 14:01:57 +02:00
parent bd04826223
commit b51d491ad9
No known key found for this signature in database
1 changed files with 7 additions and 5 deletions

View File

@ -385,13 +385,15 @@ where
for rid in self.storage.inventory()? { for rid in self.storage.inventory()? {
self.routing.insert(rid, self.node_id(), time.as_millis())?; self.routing.insert(rid, self.node_id(), time.as_millis())?;
if !self.is_tracking(&rid)? {
if self if self
.track_repo(&rid, tracking::Scope::All) .track_repo(&rid, tracking::Scope::Trusted)
.expect("Service::command: error tracking repository") .expect("Service::initialize: error tracking repository")
{ {
info!(target: "service", "Tracking local repository {rid}"); info!(target: "service", "Tracking local repository {rid}");
} }
} }
}
// Setup subscription filter for tracked repos. // Setup subscription filter for tracked repos.
self.filter = Filter::new( self.filter = Filter::new(
self.tracking self.tracking