@swydo/byol 2.0.13 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 2.0.14 (2022-04-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **byol:** add timeout delay to print all the logs ([#356](https://github.com/Swydo/byol/issues/356)) ([937393b](https://github.com/Swydo/byol/commit/937393bed0bd8c88e4776619d27f954e7077cc71))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 2.0.13 (2021-10-25)
7
18
 
8
19
  **Note:** Version bump only for package @swydo/byol
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swydo/byol",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "description": "Bring Your Own Lambda",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -27,5 +27,5 @@
27
27
  "peerDependencies": {
28
28
  "aws-xray-sdk-core": "^3.0.0"
29
29
  },
30
- "gitHead": "ddbd0d81baf30424ecf45841411e07ef8fe33994"
30
+ "gitHead": "937393bed0bd8c88e4776619d27f954e7077cc71"
31
31
  }
@@ -17,7 +17,7 @@ function hasXRay() {
17
17
  }
18
18
 
19
19
  async function execute(handler, event, awsContext) {
20
- return new Promise(((resolve, reject) => {
20
+ const handlerResult = await new Promise(((resolve, reject) => {
21
21
  const maybePromise = handler(event, awsContext, (err, res) => {
22
22
  if (err) {
23
23
  reject(err);
@@ -36,6 +36,12 @@ async function execute(handler, event, awsContext) {
36
36
  .catch((err) => reject(err));
37
37
  }
38
38
  }));
39
+
40
+ // Timeout delay is required in order to print console logs
41
+ // that are omitted otherwise
42
+ await new Promise((resolve) => setTimeout(resolve, 10));
43
+
44
+ return handlerResult;
39
45
  }
40
46
 
41
47
  async function executeWithXRay(segmentName, handler, event, awsContext) {