From d5ee180153db75f42b86bd4f500a2570c39f58a7 Mon Sep 17 00:00:00 2001 From: "Andrew J. Stone" Date: Thu, 16 Nov 2023 05:03:20 +0000 Subject: [PATCH] wip --- .../db-queries/src/db/datastore/inventory.rs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/nexus/db-queries/src/db/datastore/inventory.rs b/nexus/db-queries/src/db/datastore/inventory.rs index e42a0fb9728..337b6f5526c 100644 --- a/nexus/db-queries/src/db/datastore/inventory.rs +++ b/nexus/db-queries/src/db/datastore/inventory.rs @@ -816,15 +816,12 @@ impl DataStore { .await .map_err(|e| public_error_from_diesel(e, ErrorHandler::Server))?; - // TODO: Fix me to return a proper error - Ok(self - .inventory_collection_read_all_or_nothing( - opctx, - collection_id, - limit, - ) - .await - .unwrap()) + self.inventory_collection_read_all_or_nothing( + opctx, + collection_id, + limit, + ) + .await } /// Attempt to read the given collection while limiting queries to `limit` @@ -846,8 +843,10 @@ impl DataStore { Ok(collection) } - /// Attempt to read the given collection while limiting queries to `limit` - /// records and returning up to `limit` records. + /// Make a best effort to read the given collection while limiting queries + /// to `limit` results. Returns as much as it was able to get. The + /// returned bool indicates whether the returned collection might be + /// incomplete because the limit was reached. pub async fn inventory_collection_read_best_effort( &self, opctx: &OpContext,