Merge pull request #269 from Nekle/master
add options to reload function
This commit is contained in:
commit
51ab2963d0
@ -248,12 +248,12 @@ function configureOnceOff(config, options) {
|
||||
}
|
||||
}
|
||||
|
||||
function reloadConfiguration() {
|
||||
function reloadConfiguration(options) {
|
||||
var mtime = getMTime(configState.filename);
|
||||
if (!mtime) return;
|
||||
|
||||
if (configState.lastMTime && (mtime.getTime() > configState.lastMTime.getTime())) {
|
||||
configureOnceOff(loadConfigurationFile(configState.filename));
|
||||
configureOnceOff(loadConfigurationFile(configState.filename), options);
|
||||
}
|
||||
configState.lastMTime = mtime;
|
||||
}
|
||||
@ -275,7 +275,7 @@ function initReloadConfiguration(filename, options) {
|
||||
}
|
||||
configState.filename = filename;
|
||||
configState.lastMTime = getMTime(filename);
|
||||
configState.timerId = setInterval(reloadConfiguration, options.reloadSecs*1000);
|
||||
configState.timerId = setInterval(reloadConfiguration, options.reloadSecs*1000, options);
|
||||
}
|
||||
|
||||
function configure(configurationFileOrObject, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user