@fgiova/sqs-consumer 2.2.0 → 2.2.1

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.
@@ -38,7 +38,7 @@ export type HooksOptions = {
38
38
  };
39
39
  export type SQSConsumerOptions = {
40
40
  queueARN: string;
41
- handler: (message: Message) => Promise<any>;
41
+ handler: (message: Message) => Promise<unknown>;
42
42
  logger?: Logger;
43
43
  autostart?: boolean;
44
44
  handlerOptions?: HandlerOptions;
package/dist/cjs/index.js CHANGED
@@ -80,7 +80,7 @@ class SQSConsumer {
80
80
  try {
81
81
  let handlerResult;
82
82
  if (this.handlerOptions.executionTimeout) {
83
- const response = await unpromise_1.Unpromise.race([
83
+ handlerResult = await unpromise_1.Unpromise.race([
84
84
  handler(message),
85
85
  new Promise((_resolve, reject) => {
86
86
  setTimeout(() => {
@@ -88,7 +88,6 @@ class SQSConsumer {
88
88
  }, this.handlerOptions.executionTimeout);
89
89
  }),
90
90
  ]);
91
- handlerResult = response;
92
91
  }
93
92
  else {
94
93
  handlerResult = await handler(message);
@@ -194,7 +193,6 @@ class SQSConsumer {
194
193
  this.polling = false;
195
194
  await this.pollMessages();
196
195
  }
197
- // eslint-disable-next-line @typescript-eslint/require-await
198
196
  async start() {
199
197
  try {
200
198
  if (this.running)
@@ -38,7 +38,7 @@ export type HooksOptions = {
38
38
  };
39
39
  export type SQSConsumerOptions = {
40
40
  queueARN: string;
41
- handler: (message: Message) => Promise<any>;
41
+ handler: (message: Message) => Promise<unknown>;
42
42
  logger?: Logger;
43
43
  autostart?: boolean;
44
44
  handlerOptions?: HandlerOptions;
@@ -74,7 +74,7 @@ export class SQSConsumer {
74
74
  try {
75
75
  let handlerResult;
76
76
  if (this.handlerOptions.executionTimeout) {
77
- const response = await Unpromise.race([
77
+ handlerResult = await Unpromise.race([
78
78
  handler(message),
79
79
  new Promise((_resolve, reject) => {
80
80
  setTimeout(() => {
@@ -82,7 +82,6 @@ export class SQSConsumer {
82
82
  }, this.handlerOptions.executionTimeout);
83
83
  }),
84
84
  ]);
85
- handlerResult = response;
86
85
  }
87
86
  else {
88
87
  handlerResult = await handler(message);
@@ -188,7 +187,6 @@ export class SQSConsumer {
188
187
  this.polling = false;
189
188
  await this.pollMessages();
190
189
  }
191
- // eslint-disable-next-line @typescript-eslint/require-await
192
190
  async start() {
193
191
  try {
194
192
  if (this.running)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fgiova/sqs-consumer",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "types": "./dist/cjs/index.d.ts",
6
6
  "exports": {
@@ -56,7 +56,7 @@
56
56
  ]
57
57
  },
58
58
  "dependencies": {
59
- "@fgiova/mini-sqs-client": "^3.3.0",
59
+ "@fgiova/mini-sqs-client": "^3.4.0",
60
60
  "@watchable/unpromise": "^1.0.2",
61
61
  "p-map": "^7.0.3"
62
62
  },