Fix clean not working for webdav

This commit is contained in:
SebClem 2024-11-26 14:35:47 +01:00
parent af7c90c839
commit 82d3473761
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
2 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,9 @@ actionRouter.post("/clean", (req, res) => {
.then(() => {
return clean(backupConfig);
})
.then(() => {
return webdavClean(backupConfig, webdavConfig);
})
.then(() => {
logger.info("All good !");
})

View File

@ -644,7 +644,7 @@ export function clean(backupConfig: BackupConfig, webdavConfig: WebdavConfig) {
status.status = States.CLEAN_CLOUD;
status.progress = -1;
statusTools.setStatus(status);
const limit = backupConfig.autoClean.homeAssistant.nbrToKeep || 5;
const limit = backupConfig.autoClean.webdav.nbrToKeep || 5;
return getBackups(pathTools.auto, webdavConfig, backupConfig.nameTemplate)
.then((backups) => {
if (backups.length > limit) {