add options to reload function
if `cwd` is included in option, reload will not work
This commit is contained in:
parent
ae04cc9a4a
commit
1f1442cb7c
@ -248,12 +248,12 @@ function configureOnceOff(config, options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadConfiguration() {
|
function reloadConfiguration(options) {
|
||||||
var mtime = getMTime(configState.filename);
|
var mtime = getMTime(configState.filename);
|
||||||
if (!mtime) return;
|
if (!mtime) return;
|
||||||
|
|
||||||
if (configState.lastMTime && (mtime.getTime() > configState.lastMTime.getTime())) {
|
if (configState.lastMTime && (mtime.getTime() > configState.lastMTime.getTime())) {
|
||||||
configureOnceOff(loadConfigurationFile(configState.filename));
|
configureOnceOff(loadConfigurationFile(configState.filename), options);
|
||||||
}
|
}
|
||||||
configState.lastMTime = mtime;
|
configState.lastMTime = mtime;
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ function initReloadConfiguration(filename, options) {
|
|||||||
}
|
}
|
||||||
configState.filename = filename;
|
configState.filename = filename;
|
||||||
configState.lastMTime = getMTime(filename);
|
configState.lastMTime = getMTime(filename);
|
||||||
configState.timerId = setInterval(reloadConfiguration, options.reloadSecs*1000);
|
configState.timerId = setInterval(reloadConfiguration, options.reloadSecs*1000, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure(configurationFileOrObject, options) {
|
function configure(configurationFileOrObject, options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user