Skip to content

Commit

Permalink
fix: better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Sep 20, 2023
1 parent c6a34a8 commit 49e2d40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iroh/src/sync_engine/live.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,13 @@ impl<S: store::Store, B: baomap::Store> Actor<S, B> {
}

async fn start_sync(&mut self, namespace: NamespaceId, peers: Vec<PeerSource>) -> Result<()> {
self.ensure_subscription(namespace)?;
self.ensure_open(namespace)?;
self.syncing_replicas.insert(namespace);
self.join_peers(namespace, peers).await?;
Ok(())
}

fn ensure_subscription(&mut self, namespace: NamespaceId) -> anyhow::Result<()> {
fn ensure_open(&mut self, namespace: NamespaceId) -> anyhow::Result<()> {
if !self.open_replicas.contains(&namespace) {
let Some(replica) = self.replica_store.open_replica(&namespace)? else {
bail!("Replica not found");
Expand Down Expand Up @@ -647,7 +647,7 @@ impl<S: store::Store, B: baomap::Store> Actor<S, B> {
namespace: NamespaceId,
cb: OnLiveEventCallback,
) -> anyhow::Result<RemovalToken> {
self.ensure_subscription(namespace)?;
self.ensure_open(namespace)?;
let subs = self.event_subscriptions.entry(namespace).or_default();
let removal_id = self
.event_removal_id
Expand Down

0 comments on commit 49e2d40

Please sign in to comment.