mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Merge branch 'master' of gitlab.com:MrFry/mrfrys-node-server
This commit is contained in:
commit
70e7af0ba0
1 changed files with 3 additions and 4 deletions
|
@ -108,7 +108,7 @@ function LogReq(
|
||||||
if (req.url.includes('lred')) {
|
if (req.url.includes('lred')) {
|
||||||
dl += C('red')
|
dl += C('red')
|
||||||
}
|
}
|
||||||
if (!shouldLog(req.session.user.id, noLogIds)) {
|
if (req.session && req.session.user && !shouldLog(req.session.user.id, noLogIds)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,14 +220,13 @@ function Load(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function shouldLog(userId: string | number, nolog: string[]): boolean {
|
export function shouldLog(userId: string | number, nolog: string[]): boolean {
|
||||||
return nolog.some((noLogId) => {
|
return !nolog.some((noLogId) => {
|
||||||
return noLogId === userId.toString()
|
return noLogId === userId.toString()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function LogStat(url: string, hostname: string, userId: number | string): void {
|
function LogStat(url: string, hostname: string, userId: number | string): void {
|
||||||
const nolog = shouldLog(userId, noLogIds)
|
if (!shouldLog(userId, noLogIds)) {
|
||||||
if (nolog) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue