mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Changed short variable names to something longer
This commit is contained in:
parent
ffdb2c6db6
commit
bde4580806
1 changed files with 33 additions and 33 deletions
|
@ -66,7 +66,7 @@ try {
|
|||
}
|
||||
} catch (err) {
|
||||
logger.Log('Failed to read extra modules file')
|
||||
console.log(err)
|
||||
console.error(err)
|
||||
}
|
||||
|
||||
// Setting up exits
|
||||
|
@ -77,17 +77,17 @@ process.on('SIGTERM', () => exit('SIGTERM'))
|
|||
function exit(reason) {
|
||||
console.log()
|
||||
logger.Log(`Exiting, reason: ${reason}`)
|
||||
Object.keys(modules).forEach((k, i) => {
|
||||
const x = modules[k]
|
||||
if (x.cleanup) {
|
||||
Object.keys(modules).forEach((key) => {
|
||||
const module = modules[key]
|
||||
if (module.cleanup) {
|
||||
try {
|
||||
x.cleanup()
|
||||
} catch (e) {
|
||||
module.cleanup()
|
||||
} catch (err) {
|
||||
logger.Log(
|
||||
`Error in ${k} cleanup! Details in STDERR`,
|
||||
`Error in ${key} cleanup! Details in STDERR`,
|
||||
logger.GetColor('redbg')
|
||||
)
|
||||
console.error(e)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -137,35 +137,35 @@ app.use(
|
|||
})
|
||||
)
|
||||
|
||||
Object.keys(modules).forEach(function(k, i) {
|
||||
let x = modules[k]
|
||||
Object.keys(modules).forEach(function(key) {
|
||||
let module = modules[key]
|
||||
try {
|
||||
let mod = require(x.path)
|
||||
let mod = require(module.path)
|
||||
logger.Log(`Loading ${mod.name} module`, logger.GetColor('yellow'))
|
||||
|
||||
x.publicdirs.forEach((pdir) => {
|
||||
module.publicdirs.forEach((pdir) => {
|
||||
utils.CreatePath(pdir)
|
||||
})
|
||||
|
||||
if (mod.setup) {
|
||||
mod.setup({
|
||||
url: 'https://' + x.urls[0],
|
||||
url: 'https://' + module.urls[0],
|
||||
userDB: userDB,
|
||||
publicdirs: x.publicdirs,
|
||||
nextdir: x.nextdir,
|
||||
publicdirs: module.publicdirs,
|
||||
nextdir: module.nextdir,
|
||||
})
|
||||
}
|
||||
|
||||
const modApp = mod.getApp()
|
||||
x.app = modApp.app
|
||||
x.dailyAction = modApp.dailyAction
|
||||
x.cleanup = modApp.cleanup
|
||||
module.app = modApp.app
|
||||
module.dailyAction = modApp.dailyAction
|
||||
module.cleanup = modApp.cleanup
|
||||
|
||||
x.urls.forEach((url) => {
|
||||
app.use(vhost(url, x.app))
|
||||
module.urls.forEach((url) => {
|
||||
app.use(vhost(url, module.app))
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -191,9 +191,9 @@ if (
|
|||
ca: ca,
|
||||
}
|
||||
certsLoaded = true
|
||||
} catch (e) {
|
||||
} catch (err) {
|
||||
logger.Log('Error loading cert files!', logger.GetColor('redbg'))
|
||||
console.log(e)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,19 +229,19 @@ function setLogTimer() {
|
|||
|
||||
function LogTimerAction() {
|
||||
logger.DebugLog(`Running Log Timer Action`, 'daily', 1)
|
||||
Object.keys(modules).forEach((k, i) => {
|
||||
const x = modules[k]
|
||||
logger.DebugLog(`Ckecking ${k}`, 'daily', 1)
|
||||
if (x.dailyAction) {
|
||||
Object.keys(modules).forEach((key) => {
|
||||
const module = modules[key]
|
||||
logger.DebugLog(`Ckecking ${key}`, 'daily', 1)
|
||||
if (module.dailyAction) {
|
||||
try {
|
||||
logger.Log(`Running daily action of ${k}`)
|
||||
x.dailyAction()
|
||||
} catch (e) {
|
||||
logger.Log(`Running daily action of ${key}`)
|
||||
module.dailyAction()
|
||||
} catch (err) {
|
||||
logger.Log(
|
||||
`Error in ${k} daily action! Details in STDERR`,
|
||||
`Error in ${key} daily action! Details in STDERR`,
|
||||
logger.GetColor('redbg')
|
||||
)
|
||||
console.err(e)
|
||||
console.err(err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue