mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Daily actions fix, typo fix, incremented maxPWCount
This commit is contained in:
parent
3aa36520d4
commit
f3e6f21ad5
2 changed files with 22 additions and 8 deletions
|
@ -47,7 +47,7 @@ const usersDbBackupPath = 'data/dbs/backup'
|
|||
|
||||
const maxVeteranPwGetCount = 10
|
||||
const addPWPerDay = 1 // every x day a user can give a pw
|
||||
const maxPWCount = 4 // maximum pw give opportunities a user can have at once
|
||||
const maxPWCount = 6 // maximum pw give opportunities a user can have at once
|
||||
const daysAfterUserGetsPWs = 2 // days after user gets pw-s
|
||||
|
||||
let userDB
|
||||
|
@ -144,7 +144,7 @@ function GetApp () {
|
|||
created: utils.GetDateString()
|
||||
})
|
||||
|
||||
logger.Log(`User #${requestingUser.id} creted new user #${insertRes.lastInsertRowid}`, logger.GetColor('cyan'))
|
||||
logger.Log(`User #${requestingUser.id} created new user #${insertRes.lastInsertRowid}`, logger.GetColor('cyan'))
|
||||
|
||||
res.json({
|
||||
result: 'success',
|
||||
|
@ -590,6 +590,7 @@ function GetApp () {
|
|||
|
||||
function IncrementAvaiblePWs () {
|
||||
// FIXME: check this if this is legit and works
|
||||
logger.Log('Incrementing avaible PW-s ...')
|
||||
const users = dbtools.SelectAll(userDB, 'users')
|
||||
const today = new Date()
|
||||
const getDayDiff = (dateString) => {
|
||||
|
@ -619,14 +620,14 @@ function GetApp () {
|
|||
})
|
||||
}
|
||||
|
||||
function DailyActions () {
|
||||
function DailyAction () {
|
||||
ExportDailyDataCount()
|
||||
BackupDB()
|
||||
IncrementAvaiblePWs()
|
||||
}
|
||||
|
||||
return {
|
||||
DailyActions: DailyActions,
|
||||
dailyAction: DailyAction,
|
||||
app: app
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue