mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Silence remove invalid sessions debug log
This commit is contained in:
parent
2cb3808326
commit
08d16ce7c2
@ -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 => {
|
||||
|
@ -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`)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user