From 587de2cb8031ad3d2acea192c4fe3f1d42cb183f Mon Sep 17 00:00:00 2001 From: Andre Rabold Date: Wed, 22 Jun 2022 16:50:47 +0200 Subject: [PATCH] 2.5.2 --- dist/git-rev.js | 2 +- dist/index.js | 16 ++++++++++++---- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dist/git-rev.js b/dist/git-rev.js index 404ecdb..e75966c 100644 --- a/dist/git-rev.js +++ b/dist/git-rev.js @@ -98,7 +98,7 @@ var GitRev = /** @class */ (function () { GitRev.prototype.exactTag = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - // Suppress errors + // Suppress errors as this will fail if no tag exists yet return [2 /*return*/, this._command("git describe --exact-match --tags HEAD").catch(function () { return undefined; })]; }); }); diff --git a/dist/index.js b/dist/index.js index 623126d..03599e7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49,6 +49,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", { value: true }); exports.SentryPlugin = void 0; var path = require("path"); +var promise_pool_1 = require("@supercharge/promise-pool"); var AdmZip = require("adm-zip"); var SemVer = require("semver"); var request = require("superagent"); @@ -547,7 +548,7 @@ var SentryPlugin = /** @class */ (function () { // Nothing to do return [2 /*return*/]; } - this.serverless.cli.log("Uploading sourcemaps to sentry", "sentry"); + this.serverless.cli.log("Uploading source maps to Sentry", "sentry"); artifacts = new Set(this.serverless.service .getAllFunctions() .map(function (name) { var _a; return (_a = _this.serverless.service.getFunction(name).package) === null || _a === void 0 ? void 0 : _a.artifact; }) @@ -561,10 +562,17 @@ var SentryPlugin = /** @class */ (function () { } }); }); - // Upload artifacts one after the other - return [4 /*yield*/, results.reduce(function (previousPromise, nextArtifact) { return previousPromise.then(function () { return nextArtifact(); }); }, Promise.resolve())]; + // Upload artifacts + return [4 /*yield*/, promise_pool_1.PromisePool.withConcurrency(5) + .for(results) + .process(function (nextArtifact) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, nextArtifact()]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); }); })]; case 1: - // Upload artifacts one after the other + // Upload artifacts _a.sent(); return [2 /*return*/]; } diff --git a/package-lock.json b/package-lock.json index 8ec8b18..844aa9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "serverless-sentry", - "version": "2.5.1", + "version": "2.5.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "serverless-sentry", - "version": "2.5.1", + "version": "2.5.2", "license": "MIT", "dependencies": { "@supercharge/promise-pool": "^2.3.0", diff --git a/package.json b/package.json index 4db916f..30f0d82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-sentry", - "version": "2.5.1", + "version": "2.5.2", "description": "Serverless Sentry Plugin - Automatically send errors and exceptions to Sentry (https://sentry.io)", "license": "MIT", "repository": {