Skip to content

Commit

Permalink
.... I think this is wrong and leaking to a leak (#96)
Browse files Browse the repository at this point in the history
needs a test -- thanks to @jessfraz for the report
  • Loading branch information
paultag authored Sep 10, 2024
1 parent 4c876cf commit 816279e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bambu/discover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ impl DiscoverTrait for X1CarbonDiscover {
continue;
}

if printers.read().await.contains_key(&ip.to_string()) {
tracing::debug!("Printer already discovered, skipping");
continue;
}

let Some(name) = name else {
tracing::warn!("No name found for printer at {}", ip);
continue;
Expand All @@ -175,6 +170,11 @@ impl DiscoverTrait for X1CarbonDiscover {
continue;
};

if printers.read().await.contains_key(&machine_api_id) {
tracing::debug!("Printer already discovered, skipping");
continue;
}

// Add a mqtt client for this printer.
let serial = serial.as_deref().unwrap_or_default();

Expand Down

0 comments on commit 816279e

Please sign in to comment.