Merge pull request #269 from Nekle/master

add options to reload function
This commit is contained in:
Gareth Jones 2015-01-10 15:21:46 +11:00
commit 51ab2963d0

View File

@ -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) {