8000 add options to reload function · yanxi123-com/log4js-node@1f1442c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f1442c

Browse files
committed
add options to reload function
if `cwd` is included in option, reload will not work
1 parent ae04cc9 commit 1f1442c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/log4js.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ function configureOnceOff(config, options) {
248248
}
249249
}
250250

251-
function reloadConfiguration() {
251+
function reloadConfiguration(options) {
252252
var mtime = getMTime(configState.filename);
253253
if (!mtime) return;
254-
254+
255255
if (configState.lastMTime && (mtime.getTime() > configState.lastMTime.getTime())) {
256-
configureOnceOff(loadConfigurationFile(configState.filename));
256+
configureOnceOff(loadConfigurationFile(configState.filename), options);
257257
}
258258
configState.lastMTime = mtime;
259259
}
@@ -275,7 +275,7 @@ function initReloadConfiguration(filename, options) {
275275
}
276276
configState.filename = filename;
277277
configState.lastMTime = getMTime(filename);
278-
configState.timerId = setInterval(reloadConfiguration, options.reloadSecs*1000);
278+
configState.timerId = setInterval(reloadConfiguration, options.reloadSecs*1000, options);
279279
}
280280

281281
function configure(configurationFileOrObject, options) {

0 commit comments

Comments
 (0)
0