@nxtedition/lib 21.3.5 → 21.3.6
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 +18 -6
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -273,7 +273,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
275
|
|
|
276
|
-
setInterval(() => {
|
|
276
|
+
const lagInterval = setInterval(() => {
|
|
277
277
|
let currentLag = Math.max(0, histogram.mean / 1e6 - resolution)
|
|
278
278
|
if (Number.isNaN(currentLag)) {
|
|
279
279
|
currentLag = 0
|
|
@@ -295,7 +295,12 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
295
295
|
appLag = Math.max(appLag, lag ?? 0)
|
|
296
296
|
}
|
|
297
297
|
appLag$.next(appLag)
|
|
298
|
-
}, interval)
|
|
298
|
+
}, interval)
|
|
299
|
+
|
|
300
|
+
destroyers.unshift(() => {
|
|
301
|
+
clearInterval(lagInterval)
|
|
302
|
+
lagBC.close()
|
|
303
|
+
})
|
|
299
304
|
|
|
300
305
|
toobusy = () => currentLag$.value > maxLag
|
|
301
306
|
toobusy.lag = () => currentLag$.value
|
|
@@ -453,9 +458,14 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
453
458
|
}
|
|
454
459
|
}
|
|
455
460
|
|
|
456
|
-
setInterval(() => {
|
|
461
|
+
const memoryUsageInterval = setInterval(() => {
|
|
457
462
|
memoryUsageBC.postMessage({ data: process.memoryUsage(), id: serviceWorkerId })
|
|
458
|
-
}, 1e3)
|
|
463
|
+
}, 1e3)
|
|
464
|
+
|
|
465
|
+
destroyers.unshift(() => {
|
|
466
|
+
clearInterval(memoryUsageInterval)
|
|
467
|
+
memoryUsageBC.close()
|
|
468
|
+
})
|
|
459
469
|
|
|
460
470
|
const startTime = Date.now()
|
|
461
471
|
stats$ = stats$.pipe(
|
|
@@ -814,6 +824,9 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
814
824
|
destroyers.unshift(() => {
|
|
815
825
|
inspector.close()
|
|
816
826
|
inspectBC.postMessage({ type: 'inspect:unregister', id: serviceWorkerId })
|
|
827
|
+
setTimeout(() => {
|
|
828
|
+
inspectBC.close()
|
|
829
|
+
}, 100)
|
|
817
830
|
})
|
|
818
831
|
} else {
|
|
819
832
|
inspectBC.onmessage = ({ data }) => {
|
|
@@ -825,10 +838,9 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
825
838
|
inspectSet.delete(data.id)
|
|
826
839
|
}
|
|
827
840
|
}
|
|
841
|
+
destroyers.unshift(() => inspectBC.close())
|
|
828
842
|
}
|
|
829
843
|
|
|
830
|
-
destroyers.unshift(() => inspectBC.close())
|
|
831
|
-
|
|
832
844
|
if (appConfig.http) {
|
|
833
845
|
const httpConfig = { ...appConfig.http, ...config.http }
|
|
834
846
|
|