From ec9b4f89e7f5137371f485d78328874e5c32d6cb Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 8 May 2020 16:57:35 +0200
Subject: [PATCH] feat(internal): parallel changelog retrieval (#6174)

---
 lib/workers/repository/index.ts | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/workers/repository/index.ts b/lib/workers/repository/index.ts
index 37574b2ea5..0e2f247bdb 100644
--- a/lib/workers/repository/index.ts
+++ b/lib/workers/repository/index.ts
@@ -39,11 +39,15 @@ export async function renovateRepository(
       config
     );
     await ensureOnboardingPr(config, packageFiles, branches);
-    for (const branch of branches) {
-      for (const upgrade of branch.upgrades) {
-        upgrade.logJSON = await getChangeLogJSON(upgrade);
-      }
-    }
+    await Promise.all(
+      branches.map(async (branch) => {
+        await Promise.all(
+          branch.upgrades.map(async (upgrade) => {
+            upgrade.logJSON = await getChangeLogJSON(upgrade); // eslint-disable-line no-param-reassign
+          })
+        );
+      })
+    );
     addSplit('changelogs');
     const res = await updateRepo(config, branches, branchList);
     addSplit('update');
-- 
GitLab