@nxtedition/lib 21.3.7 → 21.3.9
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 -3
- package/couch.js +2 -1
- package/package.json +1 -1
- package/timers.js +7 -5
package/app.js
CHANGED
|
@@ -250,7 +250,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
250
250
|
if (appConfig.toobusy) {
|
|
251
251
|
const resolution = 10
|
|
252
252
|
const interval = 500
|
|
253
|
-
const maxLag =
|
|
253
|
+
const maxLag = 100
|
|
254
254
|
const id = xuid()
|
|
255
255
|
|
|
256
256
|
const currentLag$ = new rxjs.BehaviorSubject(0)
|
|
@@ -281,9 +281,9 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
281
281
|
histogram.reset()
|
|
282
282
|
|
|
283
283
|
if (currentLag > 1e3) {
|
|
284
|
-
logger?.error({ currentLag }, 'lag')
|
|
284
|
+
logger?.error({ currentLag, elapsedTime: currentLag }, 'lag')
|
|
285
285
|
} else if (currentLag > maxLag) {
|
|
286
|
-
logger?.warn({ currentLag }, 'lag')
|
|
286
|
+
logger?.warn({ currentLag, elapsedTime: currentLag }, 'lag')
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
currentLag$.next(currentLag)
|
package/couch.js
CHANGED
|
@@ -288,6 +288,8 @@ export function makeCouch(opts) {
|
|
|
288
288
|
})
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
retryCount = 0
|
|
292
|
+
|
|
291
293
|
src = ures.body
|
|
292
294
|
|
|
293
295
|
const changes = []
|
|
@@ -384,7 +386,6 @@ export function makeCouch(opts) {
|
|
|
384
386
|
const ret = []
|
|
385
387
|
ret.lastSeq = params.since
|
|
386
388
|
yield ret
|
|
387
|
-
|
|
388
389
|
return
|
|
389
390
|
}
|
|
390
391
|
}
|
package/package.json
CHANGED
package/timers.js
CHANGED
|
@@ -40,8 +40,8 @@ function refreshTimeout() {
|
|
|
40
40
|
if (fastNowTimeout && fastNowTimeout.refresh) {
|
|
41
41
|
fastNowTimeout.refresh()
|
|
42
42
|
} else {
|
|
43
|
-
clearTimeout(fastNowTimeout)
|
|
44
|
-
fastNowTimeout = setTimeout(onTimeout, 500)
|
|
43
|
+
global.clearTimeout(fastNowTimeout)
|
|
44
|
+
fastNowTimeout = global.setTimeout(onTimeout, 500)
|
|
45
45
|
if (fastNowTimeout.unref) {
|
|
46
46
|
fastNowTimeout.unref()
|
|
47
47
|
}
|
|
@@ -80,13 +80,15 @@ class Timeout {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export function setTimeout(callback, delay, opaque) {
|
|
83
|
-
return delay < 1e3
|
|
83
|
+
return delay < 1e3
|
|
84
|
+
? global.setTimeout(callback, delay, opaque)
|
|
85
|
+
: new Timeout(callback, delay, opaque)
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
export function clearTimeout(timeout) {
|
|
87
89
|
if (timeout instanceof Timeout) {
|
|
88
90
|
timeout.clear()
|
|
89
|
-
} else {
|
|
90
|
-
clearTimeout(timeout)
|
|
91
|
+
} else if (timeout == null) {
|
|
92
|
+
global.clearTimeout(timeout)
|
|
91
93
|
}
|
|
92
94
|
}
|