From 7ca5a4f4a4f3e422b93dddcbca77e052cd15eb13 Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Tue, 6 Aug 2024 14:49:16 -0700 Subject: [PATCH] Return promise in pMap --- x-pack/plugins/fleet/server/services/package_policy.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index e2aab5d5f4b8c..5dac0cc2b09e5 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -2037,7 +2037,12 @@ class PackagePolicyClientImpl implements PackagePolicyClient { await pMap( packagePolicies, (packagePolicy) => { - this.update(soClient, esClient, packagePolicy.id, getPackagePolicyUpdate(packagePolicy)); + return this.update( + soClient, + esClient, + packagePolicy.id, + getPackagePolicyUpdate(packagePolicy) + ); }, { concurrency: 50,