added ability to change configs without restart

This commit is contained in:
coderaiser 2013-02-22 11:36:09 -05:00
parent ac18f7143b
commit 21f0abedf4
3 changed files with 190 additions and 193 deletions

View file

@ -179,8 +179,7 @@
}
function readConfig(pCallBack){
var lConfPath = JSONDIR + 'config.json',
lReaded;
var lConfPath = JSONDIR + 'config.json';
fs.readFile(lConfPath, function(pError, pData){
if(!pError){
@ -197,14 +196,10 @@
if(!Config)
fs.watch(lConfPath, function(){
if(!lReaded){
lReaded = true;
readConfig();
}
/* every catch up - calling twice */
setTimeout(function() {
lReaded = false;
}, 10000);
readConfig();
}, 1000);
});
}