mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
NoLog file watching
This commit is contained in:
parent
7bf2e4de76
commit
adef37c8ad
3 changed files with 29 additions and 6 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue