@seidor-cloud-produtos/orbit-backend-lib 2.0.62 → 2.0.64

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.
@@ -55,13 +55,13 @@ class SQSScaledJobRunner {
55
55
  QueueUrl: this.queueUrl,
56
56
  ReceiptHandle: rawMessage.ReceiptHandle,
57
57
  }));
58
- consumedMessages++;
59
58
  this.logger.info('[SQSScaledJobRunner] Mensagem deletada');
60
59
  }
61
60
  catch (error) {
62
61
  this.logger.info(`[SQSScaledJobRunner] Erro: ${JSON.stringify(error)}`);
63
62
  }
64
63
  finally {
64
+ consumedMessages++;
65
65
  this.logger.info(`[SQSScaledJobRunner] Mensagens consumidas: ${consumedMessages}`);
66
66
  }
67
67
  }
@@ -71,11 +71,10 @@ class SQSScaledJobRunner {
71
71
  this.timedOut = true;
72
72
  }
73
73
  async run() {
74
- const promises = [this.process()];
75
74
  if (this.options.processTimeoutSeconds) {
76
- promises.push(this.timeout(this.options.processTimeoutSeconds));
75
+ this.timeout(this.options.processTimeoutSeconds);
77
76
  }
78
- await Promise.race(promises);
77
+ await this.process();
79
78
  }
80
79
  }
81
80
  exports.SQSScaledJobRunner = SQSScaledJobRunner;
@@ -31,7 +31,10 @@ class ExpressMappingModel extends mapping_model_1.MappingModel {
31
31
  return this;
32
32
  }
33
33
  deleteParams() {
34
- delete this.getBody()['api-gateway-params'];
34
+ const body = this.getBody();
35
+ if (body) {
36
+ delete this.getBody()['api-gateway-params'];
37
+ }
35
38
  return this;
36
39
  }
37
40
  setBody() {
@@ -8,7 +8,7 @@ class MappingModel {
8
8
  }
9
9
  parse() {
10
10
  const body = this.getBody();
11
- const params = body['api-gateway-params'];
11
+ const params = body ? body['api-gateway-params'] : undefined;
12
12
  if (!params)
13
13
  return this.next();
14
14
  for (const key in params.header) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "2.0.62",
3
+ "version": "2.0.64",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",