Server stat fixes

This commit is contained in:
mrfry 2021-04-28 17:38:55 +02:00
parent c1197533c7
commit 194b05b13e

View file

@ -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) {
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 = [
[