X-Git-Url: http://git.pjr.cc/?p=nodejs-repoproxy.git;a=blobdiff_plain;f=lib%2Fconfig.js;h=dd13be4da4478ac844938be415b20df78009d0d6;hp=8d5de4bc5d8fd99280b57d0546795453de304b69;hb=c3e6676d533e875b020d231075aac04e4b885677;hpb=48d657a4697bd9239f7ce9e4d7a479e08e1cb04e diff --git a/lib/config.js b/lib/config.js index 8d5de4b..dd13be4 100644 --- a/lib/config.js +++ b/lib/config.js @@ -6,6 +6,7 @@ exports.loadConfig = function (conffile) { global.repoproxy.listenPort = 8008; global.repoproxy.cacheDir = "./cache"; global.repoproxy.repo = new Object(); + global.repoproxy.scancache = 1; var confFileData = fs.readFileSync(conffile, "utf8"); @@ -40,9 +41,17 @@ exports.loadConfig = function (conffile) { console.log("Port set to: ", line_real[1]); global.repoproxy.listenPort = line_real[1]; break; + case "cachescan": + console.log("Set cache scan rate to: '%s' hours", line_real[1]); + global.repoproxy.scancache = parseInt(line_real[1]); + if(global.repoproxy.scancache == 0) { + console.log("Cache scan rate didnt make sense, it was 0, and should be at least 1 - it is set to 24, but you should check this setting"); + global.repoproxy.scancache = 24; + } + break; default: if(line_real[0] != "") { - console.log("Invalid line in configuration file ignored: '%s'", line_one); + console.log("WARNING Invalid line in configuration file ignored: '%s'", line_one); } } }