odsl-javascript-sdk 1.1.2 → 1.1.4

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,7 +1,7 @@
1
1
  {
2
2
  "name": "odsl-javascript-sdk",
3
3
  "type": "commonjs",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "description": "Javascript SDK for OpenDataDSL",
6
6
  "main": "src/odsl.js",
7
7
  "scripts": {
package/src/odsl.js CHANGED
@@ -19,9 +19,9 @@ module.exports = class ODSL_SDK {
19
19
  this.token = loginResponse.accessToken;
20
20
  let stage = process.env.ODSL_STAGE;
21
21
  if (stage == 'dev')
22
- host = "https://odsl-dev.azurewebsites.net/api/";
22
+ this.host = "https://odsl-dev.azurewebsites.net/api/";
23
23
  else if (stage == 'local')
24
- host = "http://localhost:7071/api/";
24
+ this.host = "http://localhost:7071/api/";
25
25
  }
26
26
  static async login() {
27
27
  try {
package/src/process.js CHANGED
@@ -4,14 +4,13 @@ module.exports = class PROCESS {
4
4
  constructor(p, task) {
5
5
  this.process = p;
6
6
  this.task = task;
7
- var cstr = process.env.ODSL_SB_CPM;
8
- this.serviceBusClient = new ServiceBusClient(cstr);
9
7
  this.started = false;
10
8
  this.queue_name = process.env.ODSL_STAGE + "/process-execution";
11
9
  }
12
10
 
13
11
  async startProcess() {
14
12
  if (!this.started) {
13
+ this.serviceBusClient = new ServiceBusClient(process.env.ODSL_SB_CPM);
15
14
  console.log("Starting process for task: " + this.task._id);
16
15
  var message = new ProcessMessage(this.process, this.task);
17
16
  message.status = "start";
@@ -26,6 +25,7 @@ module.exports = class PROCESS {
26
25
  message.message = mess;
27
26
  console.log(mess);
28
27
  await this.updateProcess(message);
28
+ this.serviceBusClient.close();
29
29
  }
30
30
 
31
31
  async startPhase(name) {
@@ -63,6 +63,7 @@ module.exports = class PROCESS {
63
63
  }
64
64
  var sender = this.serviceBusClient.createSender(this.queue_name);
65
65
  await sender.sendMessages(sbm);
66
+ await sender.close();
66
67
  }
67
68
  }
68
69