@nxtedition/lib 23.0.1 → 23.0.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 +20 -18
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -77,24 +77,6 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
77
77
|
logger?.warn({ err }, 'warning')
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
const dailyOffpeakTime = config.dailyOffpeakTime ?? '00:00-04:00'
|
|
81
|
-
|
|
82
|
-
if (dailyOffpeakTime) {
|
|
83
|
-
const [start, end] = dailyOffpeakTime.split('-')
|
|
84
|
-
|
|
85
|
-
let wasOffpeak = null
|
|
86
|
-
setInterval(() => {
|
|
87
|
-
if (isTimeBetween(new Date(), start, end)) {
|
|
88
|
-
if (!wasOffpeak && global.gc) {
|
|
89
|
-
global.gc()
|
|
90
|
-
}
|
|
91
|
-
wasOffpeak = true
|
|
92
|
-
} else {
|
|
93
|
-
wasOffpeak = false
|
|
94
|
-
}
|
|
95
|
-
}, 60e3).unref()
|
|
96
|
-
}
|
|
97
|
-
|
|
98
80
|
const cleanAppConfig = ({
|
|
99
81
|
status,
|
|
100
82
|
stats,
|
|
@@ -158,6 +140,24 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
158
140
|
} (module:${serviceModule}; instance:${serviceInstanceId}) worker:${serviceWorkerId} Node/${process.version}`) ??
|
|
159
141
|
null)
|
|
160
142
|
|
|
143
|
+
const dailyOffpeakTime = config.dailyOffpeakTime ?? '00:00-04:00'
|
|
144
|
+
|
|
145
|
+
if (dailyOffpeakTime) {
|
|
146
|
+
const [start, end] = dailyOffpeakTime.split('-')
|
|
147
|
+
|
|
148
|
+
let wasOffpeak = null
|
|
149
|
+
setInterval(() => {
|
|
150
|
+
if (isTimeBetween(new Date(), start, end)) {
|
|
151
|
+
if (!wasOffpeak && global.gc) {
|
|
152
|
+
global.gc()
|
|
153
|
+
}
|
|
154
|
+
wasOffpeak = true
|
|
155
|
+
} else {
|
|
156
|
+
wasOffpeak = false
|
|
157
|
+
}
|
|
158
|
+
}, 60e3).unref()
|
|
159
|
+
}
|
|
160
|
+
|
|
161
161
|
{
|
|
162
162
|
const loggerConfig = { ...appConfig.logger, ...config.logger }
|
|
163
163
|
|
|
@@ -931,6 +931,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
931
931
|
}
|
|
932
932
|
})
|
|
933
933
|
.listen(port)
|
|
934
|
+
.unref()
|
|
934
935
|
|
|
935
936
|
logger.debug({ port }, 'inspect listening')
|
|
936
937
|
|
|
@@ -1023,6 +1024,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
1023
1024
|
}
|
|
1024
1025
|
})
|
|
1025
1026
|
.listen(port)
|
|
1027
|
+
.unref()
|
|
1026
1028
|
|
|
1027
1029
|
logger.debug({ port }, 'utils listening')
|
|
1028
1030
|
|