mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
pw info response update, loading submodules
This commit is contained in:
parent
8bb5ea8bcf
commit
082d983b40
6 changed files with 24 additions and 9 deletions
|
@ -10,7 +10,7 @@ interface Options {
|
|||
|
||||
const testUser = {
|
||||
id: 19,
|
||||
avaiblePWRequests: 999,
|
||||
avaiblePWRequests: 645,
|
||||
pwRequestCount: 19,
|
||||
created: new Date(),
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
"name": "api",
|
||||
"urls": [
|
||||
"api.frylabs.net",
|
||||
"localhost"
|
||||
"localhost",
|
||||
"superhedghog.frylabs.net"
|
||||
]
|
||||
},
|
||||
"main": {
|
||||
|
|
|
@ -159,6 +159,12 @@ function GetApp(): ModuleType {
|
|||
})
|
||||
}
|
||||
|
||||
submoduleDatas.forEach((data) => {
|
||||
if (data.load) {
|
||||
data.load()
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
dailyAction: DailyAction,
|
||||
app: app,
|
||||
|
|
|
@ -43,15 +43,16 @@ function setup(data: SubmoduleData): any {
|
|||
const user: User = req.session.user
|
||||
|
||||
res.json({
|
||||
result: 'success',
|
||||
success: true,
|
||||
userCreated: user.created,
|
||||
avaiblePWS: user.avaiblePWRequests,
|
||||
availablePWS: user.avaiblePWRequests,
|
||||
requestedPWS: user.pwRequestCount,
|
||||
maxPWCount: maxPWCount,
|
||||
daysAfterUserGetsPWs: daysAfterUserGetsPWs,
|
||||
addPWPerDay: addPWPerDay,
|
||||
addPWCount: addPWCount,
|
||||
dayDiff: getDayDiff(user.created),
|
||||
userCount: dbtools.TableInfo(userDB, 'users').dataCount,
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -98,10 +99,17 @@ function setup(data: SubmoduleData): any {
|
|||
)
|
||||
|
||||
res.json({
|
||||
result: 'success',
|
||||
pw: pw,
|
||||
requestedPWS: requestingUser.pwRequestCount + 1,
|
||||
remaining: requestingUser.avaiblePWRequests - 1,
|
||||
success: true,
|
||||
userCreated: requestingUser.created,
|
||||
availablePWS: requestingUser.avaiblePWRequests,
|
||||
requestedPWS: requestingUser.pwRequestCount,
|
||||
maxPWCount: maxPWCount,
|
||||
daysAfterUserGetsPWs: daysAfterUserGetsPWs,
|
||||
addPWPerDay: addPWPerDay,
|
||||
addPWCount: addPWCount,
|
||||
dayDiff: getDayDiff(requestingUser.created),
|
||||
userCount: dbtools.TableInfo(userDB, 'users').dataCount,
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ export function initWorkerPool(initData: any): void {
|
|||
},
|
||||
}
|
||||
|
||||
const threadCount = process.env.NS_THREAD_COUNT || os.cpus().length - 1
|
||||
const threadCount = process.env.NS_THREAD_COUNT || os.cpus().length
|
||||
if (process.env.NS_THREAD_COUNT) {
|
||||
logger.Log(
|
||||
`Setting thread count from enviroment variable NS_THREAD_COUNT: '${threadCount}'`,
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1b3c07fce243220b629820f9e943fb449f8291c8
|
||||
Subproject commit 3739153e95c3f75c17422d89c5e229cb97cb4abe
|
Loading…
Add table
Add a link
Reference in a new issue