Data backuping every day, and on server startup

This commit is contained in:
mrfry 2020-11-09 18:23:25 +01:00
parent 7a41281993
commit a880d67eae
4 changed files with 57 additions and 39 deletions

View file

@ -137,13 +137,18 @@ function GetApp() {
function userSpecificMotdSeenBy(id) {
if (!userSpecificMotd[id].seen) {
logger.Log(`User #${id}'s user specific motd is now seen.`, logger.GetColor('bluebg'))
logger.Log(
`User #${id}'s user specific motd is now seen.`,
logger.GetColor('bluebg')
)
userSpecificMotd[id].seen = true
utils.WriteFile(JSON.stringify(userSpecificMotd), userSpecificMotdFile)
}
}
function Load() {
actions.backupData(data)
utils.WatchFile(userSpecificMotdFile, (newData) => {
logger.Log(`User Specific Motd changed: ${newData.replace(/\/n/g, '')}`)
LoadUserSpecificMOTD()
@ -985,8 +990,9 @@ function GetApp() {
}
function DailyAction() {
ExportDailyDataCount()
actions.backupData(data)
BackupDB()
ExportDailyDataCount()
IncrementAvaiblePWs()
}