From 08d16ce7c2a29b7bd98ba74244befdc52a091ddc Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 8 Jan 2023 09:15:11 -0600 Subject: [PATCH] Silence remove invalid sessions debug log --- server/Db.js | 4 ++-- server/managers/PlaybackSessionManager.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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`) }