Added daily action to api, that logs the subj/question count

This commit is contained in:
MrFry 2020-04-01 13:13:14 +02:00
parent d37538afb3
commit 52778532dc
2 changed files with 19 additions and 2 deletions

View file

@ -98,6 +98,7 @@ Object.keys(modules).forEach(function (k, i) {
})
}
x.app = mod.app
x.dailyAction = mod.dailyAction
x.urls.forEach((url) => {
app.use(vhost(url, x.app))
})
@ -149,11 +150,17 @@ function setLogTimer () {
if (e > 100) {
setTimeout(setLogTimer, e)
} else {
logger.Log('Log timer malfunction :/')
logger.Log('Log timer malfunction :/', logger.GetColor('redbg'))
}
const line = '-------------------------------------------------------------------------------'
Object.keys(modules).forEach((k, i) => {
const x = modules[k]
if (x.dailyAction) {
x.dailyAction()
}
})
const line = '==================================================================================================================================================='
logger.Log(line)
utils.AppendToFile(line, locLogFile)
utils.AppendToFile(line, allLogFile)