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 statFile = 'stats/stats'
|
||||
const vStatFile = 'stats/vstats'
|
||||
const nologFile = './nolog'
|
||||
|
||||
const writeInterval = 10
|
||||
|
||||
|
@ -112,14 +113,20 @@ function LogReq (req, toFile, sc) {
|
|||
}
|
||||
}
|
||||
|
||||
function parseNoLogFile (newData) {
|
||||
noLogips = newData.split('\n')
|
||||
if (noLogips[noLogips.length - 1] === '') {
|
||||
noLogips.pop()
|
||||
}
|
||||
Log('\tNo Log IP-s changed: ' + noLogips.join(', '))
|
||||
}
|
||||
|
||||
function setNoLogReadInterval () {
|
||||
utils.WatchFile('./nolog', (newData) => {
|
||||
noLogips = newData.split('\n')
|
||||
if (noLogips[noLogips.length - 1] === '') {
|
||||
noLogips.pop()
|
||||
}
|
||||
Log('\tNo Log IP-s changed: ' + noLogips.join(', '))
|
||||
utils.WatchFile(nologFile, (newData) => {
|
||||
parseNoLogFile(newData)
|
||||
})
|
||||
|
||||
parseNoLogFile(utils.ReadFile(nologFile))
|
||||
}
|
||||
|
||||
function Load () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue