meadow-integration 1.0.28 → 1.0.29

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": "meadow-integration",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Meadow Data Integration",
5
5
  "bin": {
6
6
  "mdwint": "source/cli/Meadow-Integration-CLI-Run.js"
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "fable": "^3.1.67",
43
+ "fable": "^3.1.70",
44
44
  "fable-serviceproviderbase": "^3.0.19",
45
45
  "fast-xml-parser": "^4.4.1",
46
46
  "meadow": "^2.0.33",
@@ -1,6 +1,4 @@
1
1
  const libFableServiceProviderBase = require('fable-serviceproviderbase');
2
- const Http = require('http');
3
- const Https = require('https');
4
2
 
5
3
  const defaultRestClientOptions = (
6
4
  {
@@ -41,30 +39,22 @@ class MeadowCloneRestClient extends libFableServiceProviderBase
41
39
  this._SessionToken = this.options.SessionToken;
42
40
  }
43
41
 
44
- this.restClient = this.fable.serviceManager.instantiateServiceProvider('RestClient', {}, 'MeadowCloneRestClient-RestClient');
45
- this.cache = {};
46
-
47
- this.requestTimeout = this.options.RequestTimeout;
48
- this.maxRequestTimeout = this.options.MaxRequestTimeout;
42
+ // Fable settings override instance options for timeouts
43
+ this.requestTimeout = this.fable.settings.RestClientRequestTimeout || this.options.RequestTimeout;
44
+ this.maxRequestTimeout = this.fable.settings.RestClientMaxRequestTimeout || this.options.MaxRequestTimeout;
49
45
 
50
- // Use the longer of the two timeouts for the agent's socket timeout
51
- // so that MAX queries don't get killed at the socket level.
52
- const agentOptions = { keepAlive: true, timeout: Math.max(this.requestTimeout, this.maxRequestTimeout) };
53
-
54
- if (this.serverURL && this.serverURL.startsWith('http:'))
55
- {
56
- this.agent = new Http.Agent(agentOptions);
57
- }
58
- else
59
- {
60
- this.agent = new Https.Agent(agentOptions);
61
- }
62
-
63
- this.restClient.prepareRequestOptions = (pOptions) =>
64
- {
65
- pOptions.agent = this.agent;
66
- return pOptions;
67
- };
46
+ // When keep-alive is enabled via fable settings (RestClientKeepAlive), use a
47
+ // socket timeout based on the longer of the two request timeouts so that
48
+ // slow MAX queries don't get killed at the socket level.
49
+ let tmpRestClientOptions = (
50
+ {
51
+ KeepAliveAgentOptions:
52
+ {
53
+ timeout: Math.max(this.requestTimeout, this.maxRequestTimeout)
54
+ }
55
+ });
56
+ this.restClient = this.fable.serviceManager.instantiateServiceProvider('RestClient', tmpRestClientOptions, 'MeadowCloneRestClient-RestClient');
57
+ this.cache = {};
68
58
  }
69
59
 
70
60
  prepareRequestOptions(pOptions)