@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.
- package/app.js +8 -3
- package/couch.js +1 -0
- 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