@nxtedition/lib 23.0.1 → 23.0.2
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 -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
|
|