mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-06 17:31:41 +00:00
If scanLogsToKeep is <= 0 don't purge.
For now this would be a manual database update to configure this. It does help future proof the setting being set in the UI.
This commit is contained in:
parent
f069475a4e
commit
f819d661e8
1 changed files with 3 additions and 0 deletions
|
|
@ -41,6 +41,8 @@ class LogManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
async enforceDailyLogRetention() {
|
async enforceDailyLogRetention() {
|
||||||
|
if (this.loggerDailyLogsToKeep <= 0) return
|
||||||
|
|
||||||
while (this.dailyLogFiles.length > this.loggerDailyLogsToKeep) {
|
while (this.dailyLogFiles.length > this.loggerDailyLogsToKeep) {
|
||||||
await this.removeLogFile(this.dailyLogFiles[0])
|
await this.removeLogFile(this.dailyLogFiles[0])
|
||||||
}
|
}
|
||||||
|
|
@ -197,6 +199,7 @@ class LogManager {
|
||||||
*/
|
*/
|
||||||
async purgeOldScanLogs(logDir = this.ScanLogPath) {
|
async purgeOldScanLogs(logDir = this.ScanLogPath) {
|
||||||
const scanLogsToKeep = this.loggerScannerLogsToKeep
|
const scanLogsToKeep = this.loggerScannerLogsToKeep
|
||||||
|
if (scanLogsToKeep <= 0) return
|
||||||
|
|
||||||
let scanFiles
|
let scanFiles
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue