mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 07:56:23 +00:00
Fixed stats not re-generating after errors
This commit is contained in:
parent
7aaf913166
commit
2a81e899b4
@ -861,6 +861,10 @@ self.stats = async (req, res, next) => {
|
||||
return res.json({ success: true, stats })
|
||||
} catch (error) {
|
||||
logger.error(error)
|
||||
// Reset generating state when encountering any errors
|
||||
Object.keys(statsCache).forEach(key => {
|
||||
statsCache[key].generating = false
|
||||
})
|
||||
return res.status(500).json({ success: false, description: 'An unexpected error occurred. Try again?' })
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user