diff --git a/server/Db.js b/server/Db.js index 9b9c8a21..d836ef79 100644 --- a/server/Db.js +++ b/server/Db.js @@ -410,10 +410,10 @@ class Db { }) } - removeEntities(entityName, selectFunc) { + removeEntities(entityName, selectFunc, silent = false) { var entityDb = this.getEntityDb(entityName) return entityDb.delete(selectFunc).then((results) => { - Logger.debug(`[DB] Deleted entities ${entityName}: ${results.deleted}`) + if (!silent) Logger.debug(`[DB] Deleted entities ${entityName}: ${results.deleted}`) var arrayKey = this.getEntityArrayKey(entityName) if (this[arrayKey]) { this[arrayKey] = this[arrayKey].filter(e => { diff --git a/server/managers/PlaybackSessionManager.js b/server/managers/PlaybackSessionManager.js index bd1c3c99..9bcda576 100644 --- a/server/managers/PlaybackSessionManager.js +++ b/server/managers/PlaybackSessionManager.js @@ -272,7 +272,7 @@ class PlaybackSessionManager { // Remove playback sessions with listening time too high async removeInvalidSessions() { const selectFunc = (session) => isNaN(session.timeListening) || Number(session.timeListening) > 3600000000 - const numSessionsRemoved = await this.db.removeEntities('session', selectFunc) + const numSessionsRemoved = await this.db.removeEntities('session', selectFunc, true) if (numSessionsRemoved) { Logger.info(`[PlaybackSessionManager] Removed ${numSessionsRemoved} invalid playback sessions`) }