mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Server stat fixes
This commit is contained in:
parent
c1197533c7
commit
194b05b13e
1 changed files with 8 additions and 4 deletions
|
@ -28,6 +28,8 @@ const coloredWords = {
|
|||
'allqr',
|
||||
'possibleAnswers',
|
||||
'irc',
|
||||
'faq',
|
||||
'/script'
|
||||
],
|
||||
blue: ['isadding', 'ask'],
|
||||
magenta: [
|
||||
|
@ -158,7 +160,9 @@ function countLinesMatching(text, toMatch) {
|
|||
}
|
||||
|
||||
function readFile(name) {
|
||||
return fs.readFileSync(name, 'utf8')
|
||||
if (fs.existsSync(name)) {
|
||||
return fs.readFileSync(name, 'utf8')
|
||||
}
|
||||
}
|
||||
|
||||
function getLetterNTimes(letter, number) {
|
||||
|
@ -379,9 +383,9 @@ function printLastDataCount(data) {
|
|||
}
|
||||
// ------------------------------------------------------------------------------
|
||||
printHeader('Daily script install / update check count')
|
||||
const todaysLogs = readFile(`${dir}stats/vlogs/${getDayIndex()}`)
|
||||
const yesterdaysLogs = readFile(`${dir}stats/vlogs/${getDayIndex(-1)}`)
|
||||
const beforeYesterdaysLogs = readFile(`${dir}stats/vlogs/${getDayIndex(-2)}`)
|
||||
const todaysLogs = readFile(`${dir}stats/vlogs/log`)
|
||||
const yesterdaysLogs = readFile(`${dir}stats/vlogs/${getDayIndex(-1)}`) || ''
|
||||
const beforeYesterdaysLogs = readFile(`${dir}stats/vlogs/${getDayIndex(-2)}`) || ''
|
||||
|
||||
const installs = [
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue