Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Nov 16, 2023
1 parent d737ba0 commit d5ee180
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions nexus/db-queries/src/db/datastore/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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,
Expand Down

0 comments on commit d5ee180

Please sign in to comment.