@nxtedition/lib 21.3.10 → 21.4.0

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 (3) hide show
  1. package/app.js +8 -3
  2. package/couch.js +1 -0
  3. package/package.json +1 -1
package/app.js CHANGED
@@ -31,6 +31,7 @@ import { json } from 'node:stream/consumers'
31
31
  import { monitorEventLoopDelay } from 'node:perf_hooks'
32
32
  import { LRUCache } from 'lru-cache'
33
33
  import xuid from 'xuid'
34
+ import undici from 'undici'
34
35
 
35
36
  export function makeApp(appConfig, onTerminate) {
36
37
  let ds
@@ -49,6 +50,10 @@ export function makeApp(appConfig, onTerminate) {
49
50
  net.setDefaultAutoSelectFamily(false)
50
51
  }
51
52
 
53
+ if (undici.setGlobalDispatcher) {
54
+ undici.setGlobalDispatcher(new undici.Agent({ connectTimeout: 2e3 }))
55
+ }
56
+
52
57
  // Optimize some Node global defaults.
53
58
 
54
59
  Buffer.poolSize = 128 * 1024
@@ -248,9 +253,9 @@ export function makeApp(appConfig, onTerminate) {
248
253
  let toobusy
249
254
 
250
255
  if (appConfig.toobusy) {
251
- const resolution = 10
252
- const interval = 500
253
- const maxLag = 100
256
+ const resolution = appConfig.toobusy.resolution ?? 10
257
+ const interval = appConfig.toobusy.interval ?? 500
258
+ const maxLag = appConfig.toobusy.maxLag ?? 100
254
259
  const id = xuid()
255
260
 
256
261
  const currentLag$ = new rxjs.BehaviorSubject(0)
package/couch.js CHANGED
@@ -1060,6 +1060,7 @@ class PromiseOutput {
1060
1060
  const defaultDispatcher = new Agent({
1061
1061
  pipelining: 4,
1062
1062
  connections: 8,
1063
+ connectTimeout: 2e3,
1063
1064
  })
1064
1065
 
1065
1066
  export function request(url, opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "21.3.10",
3
+ "version": "21.4.0",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",