@ikonintegration/ikapi 3.1.29 → 3.1.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonintegration/ikapi",
3
- "version": "3.1.29",
3
+ "version": "3.1.30",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "main.js",
@@ -37,7 +37,7 @@ export default class IKProcess {
37
37
  await this._execute(executionFunc);
38
38
  }, this.interval);
39
39
  //Tracker
40
- if (this.allowExecutionIdentification && this.tracker) await this.tracker.trackExecAndDrain(true);
40
+ if (this.allowExecutionIdentification && this.tracker) await this.tracker.trackExecAndDrain();
41
41
  }
42
42
  //Executions
43
43
  async _execute(executionFunc) {
@@ -53,6 +53,8 @@ export default class IKTransaction {
53
53
  try { //Execute
54
54
  this.logger.debug("Starting main request code");
55
55
  this._resp = await executionFunc(this);
56
+ //Tracker after successful execution (before succeeding the context, which will cause things to die)
57
+ if (this.tracker) await this.tracker.trackExecAndDrain();
56
58
  //Answer client
57
59
  if (this._resp && this._resp instanceof IKResponse) {
58
60
  await this._resp.build(this._context, this, this._syncReturn);
@@ -102,8 +104,8 @@ export default class IKTransaction {
102
104
  try {
103
105
  await safeExecution();
104
106
  await this.logger.flushLogs();
105
- //Tracker
106
- if (this.tracker) await this.tracker.trackExecAndDrain(true);
107
+ //Tracker (if not tracked yet -- exception case)
108
+ if (this.tracker) await this.tracker.trackExecAndDrain();
107
109
  } catch (e) {
108
110
  this.logger.error('Exception when flushing logs.');
109
111
  this.logger.exception(e);