Fix: daily log rewrite, Add: purge user audiobook data for audiobooks that no longer exist

This commit is contained in:
advplyr 2021-11-04 07:59:28 -05:00
parent 411409d67e
commit b0ea2f8008
3 changed files with 35 additions and 4 deletions

View file

@ -258,9 +258,16 @@ class Db {
var orphanOldPath = Path.join(dbdatadir, orphanOld)
await fs.unlink(orphanOldPath)
console.log('Removed .old file')
var lockdirpath = Path.join(dbdatadir, `data.${dbnum}.lock`)
await fs.rmdir(lockdirpath)
console.log('Removed lock dir')
// Removing lock dir throws error in proper-lockfile
// var lockdirpath = Path.join(dbdatadir, `data.${dbnum}.json.lock`)
// var lockdirexists = await fs.pathExists(lockdirpath)
// if (lockdirexists) {
// await fs.rmdir(lockdirpath)
// console.log('Removed lock dir')
// } else {
// console.log('No lock dir found', lockdirpath)
// }
}
}
} catch (error) {