diff --git a/crates/nocontrol/src/control_plane/reconciler.rs b/crates/nocontrol/src/control_plane/reconciler.rs index 640ea69..d071c7f 100644 --- a/crates/nocontrol/src/control_plane/reconciler.rs +++ b/crates/nocontrol/src/control_plane/reconciler.rs @@ -147,12 +147,12 @@ impl Reconciler { async fn enqueue_all_manifests(&self) -> anyhow::Result<()> { for manifest_state in self.store.get_owned_and_potential_leases().await? { // Only enqueue manifests we own - if let Some(lease) = &manifest_state.lease { - if lease.owner == self.worker_id { - self.reconcile_queue - .enqueue(manifest_state.manifest.name.clone()) - .await; - } + if let Some(lease) = &manifest_state.lease + && lease.owner == self.worker_id + { + self.reconcile_queue + .enqueue(manifest_state.manifest.name.clone()) + .await; } } diff --git a/crates/nocontrol/src/reconcile_queue.rs b/crates/nocontrol/src/reconcile_queue.rs index f26e2cc..e26471c 100644 --- a/crates/nocontrol/src/reconcile_queue.rs +++ b/crates/nocontrol/src/reconcile_queue.rs @@ -167,11 +167,13 @@ impl ReconcileQueue { } } + #[cfg(test)] /// Returns the number of pending jobs in the queue. pub async fn len(&self) -> usize { self.inner.lock().await.queue.len() } + #[cfg(test)] /// Returns true if the queue is empty. pub async fn is_empty(&self) -> bool { self.inner.lock().await.queue.is_empty()