persist only changed games

This commit is contained in:
Zutatensuppe 2020-12-13 00:11:42 +01:00
parent 1ac9be4307
commit 6676dcc933
2 changed files with 42 additions and 22 deletions

View file

@ -181,7 +181,7 @@ wss.listen()
// persist games in fixed interval
const persistInterval = setInterval(() => {
console.log('Persisting games...');
Game.persistAll()
Game.persistChangedGames()
}, config.persistence.interval)
const gracefulShutdown = (signal) => {
@ -191,7 +191,7 @@ const gracefulShutdown = (signal) => {
clearInterval(persistInterval)
console.log('persisting games...')
Game.persistAll()
Game.persistChangedGames()
console.log('shutting down webserver...')
server.close()