@codefresh-io/eventbus 3.0.0-alpha.1 → 3.0.0-alpha.3

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.
Files changed (2) hide show
  1. package/lib/Bus.js +3 -3
  2. package/package.json +1 -1
package/lib/Bus.js CHANGED
@@ -96,7 +96,7 @@ class Bus extends EventEmitter {
96
96
  async waitForConsumersToFinish() {
97
97
  while (this._consumersInProgressCount > 0) {
98
98
  this._logger.info(`Waiting for ${this._consumersInProgressCount} consumers in progress to finish...`);
99
- await timers.setTimeout(1000);
99
+ await timers.setTimeout(100);
100
100
  }
101
101
  }
102
102
 
@@ -315,8 +315,8 @@ class Bus extends EventEmitter {
315
315
  ch.ack(msg);
316
316
  }
317
317
  const content = this._deserialize(msg.content.toString());
318
- this._consumersInProgressCount++;
319
- await handler(content).finally(() => this._consumersInProgressCount--);
318
+ this._consumersInProgressCount += 1;
319
+ await handler(content).finally(() => this._consumersInProgressCount -= 1);
320
320
  } catch (error) {
321
321
  subscriberEmitter.emit('error', error);
322
322
  if (!finished && waitForAck) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefresh-io/eventbus",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [