Silence remove invalid sessions debug log

This commit is contained in:
advplyr 2023-01-08 09:15:11 -06:00
parent 2cb3808326
commit 08d16ce7c2
2 changed files with 3 additions and 3 deletions

View File

@ -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 => {

View File

@ -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`)
}