mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
fix: round down system uptime
invalidate system info cache quicker (1s to 0.5s)
This commit is contained in:
parent
4f0d49dee6
commit
e31af2d267
@ -673,8 +673,8 @@ self.stats = async (req, res, next) => {
|
||||
|
||||
if (!data.cache && data.generating) {
|
||||
stats[data.title] = false
|
||||
} else if (((Date.now() - data.generatedAt) <= 1000) || data.generating) {
|
||||
// Use cache for 1000 ms (1 second)
|
||||
} else if (((Date.now() - data.generatedAt) <= 500) || data.generating) {
|
||||
// Use cache for 500 ms (0.5 seconds)
|
||||
stats[data.title] = data.cache
|
||||
} else {
|
||||
data.generating = true
|
||||
@ -713,7 +713,7 @@ self.stats = async (req, res, next) => {
|
||||
type: 'byte'
|
||||
},
|
||||
'System Uptime': {
|
||||
value: time.uptime,
|
||||
value: Math.floor(time.uptime),
|
||||
type: 'uptime'
|
||||
},
|
||||
'Node.js': `${process.versions.node}`,
|
||||
|
Loading…
Reference in New Issue
Block a user