@nxtedition/lib 19.9.1 → 19.9.3
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 +3 -1
- package/couch.js +1 -23
- package/package.json +6 -6
package/app.js
CHANGED
|
@@ -260,6 +260,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
260
260
|
for (const lag of lagMap.values()) {
|
|
261
261
|
appLag = Math.max(appLag, lag)
|
|
262
262
|
}
|
|
263
|
+
appLag$.next(appLag)
|
|
263
264
|
}, interval).unref()
|
|
264
265
|
|
|
265
266
|
destroyers.unshift(() => {
|
|
@@ -270,6 +271,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
270
271
|
toobusy = () => currentLag$.value > maxLag
|
|
271
272
|
toobusy.lag = () => currentLag$.value
|
|
272
273
|
toobusy.lag$ = currentLag$
|
|
274
|
+
toobusy.appLag = () => appLag$.value
|
|
273
275
|
toobusy.appLag$ = appLag$
|
|
274
276
|
toobusy.maxLag = maxLag
|
|
275
277
|
}
|
|
@@ -497,7 +499,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
497
499
|
rx.distinctUntilChanged(fp.isEqual),
|
|
498
500
|
rx.repeatWhen((complete$) => complete$.pipe(rx.delay(10e3))),
|
|
499
501
|
),
|
|
500
|
-
toobusy?.
|
|
502
|
+
toobusy?.appLag$.pipe(
|
|
501
503
|
rx.map((lag) => [
|
|
502
504
|
{
|
|
503
505
|
id: 'app:toobusy_lag',
|
package/couch.js
CHANGED
|
@@ -3,7 +3,6 @@ import stream from 'node:stream'
|
|
|
3
3
|
import querystring from 'node:querystring'
|
|
4
4
|
import createError from 'http-errors'
|
|
5
5
|
import { makeWeakCache } from './weakCache.js'
|
|
6
|
-
import tp from 'timers/promises'
|
|
7
6
|
import { defaultDelay as delay } from './http.js'
|
|
8
7
|
import urljoin from 'url-join'
|
|
9
8
|
import { AbortError } from './errors.js'
|
|
@@ -421,28 +420,7 @@ export function makeCouch(opts) {
|
|
|
421
420
|
const ACCEPT_HEADERS = ['Accept', 'application/json']
|
|
422
421
|
const ACCEPT_CONTENT_TYPE_HEADERS = [...ACCEPT_HEADERS, 'Content-Type', 'application/json']
|
|
423
422
|
|
|
424
|
-
|
|
425
|
-
for (let n = 0; true; ++n) {
|
|
426
|
-
try {
|
|
427
|
-
return await _request(url, opts)
|
|
428
|
-
} catch (err) {
|
|
429
|
-
if (
|
|
430
|
-
!opts.idempotent ||
|
|
431
|
-
n >= 10 ||
|
|
432
|
-
(err.code !== 'UND_ERR_SOCKET' &&
|
|
433
|
-
err.code !== 'ECONNRESET' &&
|
|
434
|
-
err.code !== 'ECONNREFUSED' &&
|
|
435
|
-
err.code !== 'EHOSTUNREACH' &&
|
|
436
|
-
err.message !== 'write EPIPE')
|
|
437
|
-
) {
|
|
438
|
-
throw err
|
|
439
|
-
}
|
|
440
|
-
await tp.setTimeout(n * 1e3)
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
function _request(
|
|
423
|
+
function request(
|
|
446
424
|
url,
|
|
447
425
|
{ params, client = defaultClient, idempotent, body, method, headers, signal },
|
|
448
426
|
) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/lib",
|
|
3
|
-
"version": "19.9.
|
|
3
|
+
"version": "19.9.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"type": "module",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@aws-sdk/client-s3": "^3.614.0",
|
|
83
83
|
"@elastic/elasticsearch": "^8.14.0",
|
|
84
84
|
"@elastic/transport": "^8.7.0",
|
|
85
|
-
"@nxtedition/nxt-undici": "^4.1
|
|
85
|
+
"@nxtedition/nxt-undici": "^4.2.1",
|
|
86
86
|
"content-type": "^1.0.5",
|
|
87
87
|
"date-fns": "^3.6.0",
|
|
88
88
|
"fast-querystring": "^1.1.1",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"nested-error-stacks": "^2.1.1",
|
|
98
98
|
"object-hash": "^3.0.0",
|
|
99
99
|
"p-queue": "^8.0.1",
|
|
100
|
-
"pino": "^9.
|
|
100
|
+
"pino": "^9.3.1",
|
|
101
101
|
"qs": "^6.12.3",
|
|
102
102
|
"request-target": "^1.0.2",
|
|
103
103
|
"smpte-timecode": "^1.3.6",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@nxtedition/deepstream.io-client-js": ">=24.2.4",
|
|
110
|
-
"@types/lodash": "^4.17.
|
|
111
|
-
"@types/node": "^20.14.
|
|
110
|
+
"@types/lodash": "^4.17.7",
|
|
111
|
+
"@types/node": "^20.14.11",
|
|
112
112
|
"eslint": "^8.0.0",
|
|
113
113
|
"eslint-config-prettier": "^9.1.0",
|
|
114
114
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"husky": "^9.0.11",
|
|
120
120
|
"lint-staged": "^15.2.7",
|
|
121
121
|
"pinst": "^3.0.0",
|
|
122
|
-
"prettier": "^3.3.
|
|
122
|
+
"prettier": "^3.3.3",
|
|
123
123
|
"rxjs": "^7.5.6",
|
|
124
124
|
"send": "^0.18.0",
|
|
125
125
|
"tap": "^21.0.0"
|