Skip to content

Commit

Permalink
Only fetch columns we want to avoid large fields
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Dec 11, 2020
1 parent ce287fd commit a593dfd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions x-pack/plugins/fleet/server/services/epm/archive/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ export async function getAsset(opts: {
export const getEsPackage = async (
pkgName: string,
pkgVersion: string,
packageAssets: SavedObjectsBulkGetObject[],
packageAssets: PackageAssetReference[],
savedObjectsClient: SavedObjectsClientContract
) => {
const pkgKey = pkgToPkgKey({ name: pkgName, version: pkgVersion });
const soRes = await savedObjectsClient.bulkGet<PackageAsset>(packageAssets);
const bulkBody: SavedObjectsBulkGetObject[] = packageAssets.map((ref) => ({
id: ref.id,
type: ref.type,
fields: ['asset_path'],
}));
const soRes = await savedObjectsClient.bulkGet<PackageAsset>(bulkBody);
const paths = soRes.saved_objects.map((asset) => asset.attributes.asset_path);

// create the packageInfo
Expand Down

0 comments on commit a593dfd

Please sign in to comment.