NoLog file watching

This commit is contained in:
MrFry 2019-11-02 09:37:31 +01:00
parent 7bf2e4de76
commit adef37c8ad
3 changed files with 29 additions and 6 deletions

View file

@ -113,10 +113,13 @@ function LogReq (req, toFile, sc) {
}
function setNoLogReadInterval () {
noLogips = utils.ReadFile('./nolog').split('\n')
setInterval(() => {
noLogips = utils.ReadFile('./nolog').split('\n')
}, 1000 * 60 * 30)
utils.WatchFile('./nolog', (newData) => {
noLogips = newData.split('\n')
if (noLogips[noLogips.length - 1] === '') {
noLogips.pop()
}
Log('\tNo Log IP-s changed: ' + noLogips.join(', '))
})
}
function Load () {