mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-01 08:44:40 +02:00
Fix: daily log rewrite, Add: purge user audiobook data for audiobooks that no longer exist
This commit is contained in:
parent
411409d67e
commit
b0ea2f8008
3 changed files with 35 additions and 4 deletions
13
server/Db.js
13
server/Db.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue