@ikonintegration/ikapi 3.1.18 → 3.1.21

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.18",
3
+ "version": "3.1.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "main.js",
@@ -17,7 +17,7 @@
17
17
  "@aws-sdk/credential-provider-node": "^3.131.0",
18
18
  "@aws-sdk/node-http-handler": "^3.127.0",
19
19
  "@aws-sdk/util-dynamodb": "^3.131.0",
20
- "@ikonintegration/mod-resources-tracker-client": "0.0.12",
20
+ "@ikonintegration/mod-resources-tracker-client": "0.0.13",
21
21
  "abind": "^1.0.5",
22
22
  "bluebird": "^3.7.2",
23
23
  "email-templates": "^8.0.8",
@@ -45,14 +45,15 @@ export default class IKProcess {
45
45
  await executionFunc(this);
46
46
  //Commit DB
47
47
  if (this.db) await this.db.commit();
48
+ //Tracker
49
+ if (this.tracker) await this.tracker.stopTracking();
50
+ //
48
51
  executionFailed = false;
49
52
  } catch (e) { /*EXECUTION FAIL*/
50
53
  this.logger.error('Exception when executing main request code. Rolling back DB!');
51
54
  this.logger.exception(e);
52
55
  //Rollback DB
53
56
  if (this.db) await this.db.rollback();
54
- //Tracker
55
- if (this.tracker) await this.tracker.stopTracking();
56
57
  } return executionFailed;
57
58
  }
58
59
  /* DB drivers support */
@@ -34,10 +34,10 @@ export default class IKExecutionTracker {
34
34
  if (Utils.isHybridlessContainer()) {
35
35
  //ECS, get metadata info and log if applicable and succeeded on it
36
36
  const context = this._getECSMetadataObject();
37
- console.debug('Context', context);
38
- if (context && context.containerInstanceArn) {
39
- const extraDetails = { startTime: this.startedOn, endTime: Date.now(), taskConfig: { cpu: process.env.CPU, memory: process.env.MEMORY } };
40
- const event = RTClient.newECSExecutionEvent(context.ecsTaskId, context.containerInstanceArn, extraDetails);
37
+ // console.debug('Context', context);
38
+ if (context && context.ContainerInstanceARN) {
39
+ const extraDetails = { startTime: this.startedOn, endTime: Date.now(), taskConfig: { cpu: process.env.CPU, memory: process.env.MEMORY, taskName: context.TaskDefinitionFamily } };
40
+ const event = RTClient.newECSExecutionEvent(context.TaskARN, context.ContainerInstanceARN, extraDetails);
41
41
  this.appendEvent(event);
42
42
  }
43
43
  } else {