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(() => { .then(() => {
return clean(backupConfig); return clean(backupConfig);
}) })
.then(() => {
return webdavClean(backupConfig, webdavConfig);
})
.then(() => { .then(() => {
logger.info("All good !"); logger.info("All good !");
}) })

View File

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