From 6a2f39bf1c6305af32a88b6179db2dd0e508a619 Mon Sep 17 00:00:00 2001 From: Kamaz Date: Wed, 11 Dec 2019 21:53:39 +0000 Subject: [PATCH] Replace forEach with for..of to allow promise to complete --- package.json | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 46119910..23ec9417 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-newrelic-lambda-layers", - "version": "0.1.7", + "version": "0.1.8", "description": "Serverless plugin for NewRelic APM AWS Lambda layers.", "main": "dist/index.js", "files": [ diff --git a/src/index.ts b/src/index.ts index 16defa8a..90a31237 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,10 +63,10 @@ export default class NewRelicLambdaLayerPlugin { } const funcs = this.functions; - Object.keys(funcs).forEach(async funcName => { + for (const funcName of Object.keys(funcs)) { const funcDef = funcs[funcName]; await this.addLayer(funcName, funcDef); - }); + } } public cleanup() {