mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Read nolog file on startup
This commit is contained in:
parent
ef827ee7b4
commit
7b9a0af287
1 changed files with 13 additions and 6 deletions
|
@ -36,6 +36,7 @@ const logFile = '/nlogs/nlogs'
|
||||||
const allLogFile = '/nlogs/log'
|
const allLogFile = '/nlogs/log'
|
||||||
const statFile = 'stats/stats'
|
const statFile = 'stats/stats'
|
||||||
const vStatFile = 'stats/vstats'
|
const vStatFile = 'stats/vstats'
|
||||||
|
const nologFile = './nolog'
|
||||||
|
|
||||||
const writeInterval = 10
|
const writeInterval = 10
|
||||||
|
|
||||||
|
@ -112,14 +113,20 @@ function LogReq (req, toFile, sc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setNoLogReadInterval () {
|
function parseNoLogFile (newData) {
|
||||||
utils.WatchFile('./nolog', (newData) => {
|
|
||||||
noLogips = newData.split('\n')
|
noLogips = newData.split('\n')
|
||||||
if (noLogips[noLogips.length - 1] === '') {
|
if (noLogips[noLogips.length - 1] === '') {
|
||||||
noLogips.pop()
|
noLogips.pop()
|
||||||
}
|
}
|
||||||
Log('\tNo Log IP-s changed: ' + noLogips.join(', '))
|
Log('\tNo Log IP-s changed: ' + noLogips.join(', '))
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNoLogReadInterval () {
|
||||||
|
utils.WatchFile(nologFile, (newData) => {
|
||||||
|
parseNoLogFile(newData)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
parseNoLogFile(utils.ReadFile(nologFile))
|
||||||
}
|
}
|
||||||
|
|
||||||
function Load () {
|
function Load () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue