clean up task locks

This commit is contained in:
Girish Ramakrishnan
2025-07-18 18:11:56 +02:00
parent 697b42c70f
commit 7e0803c4b4
3 changed files with 6 additions and 0 deletions

View File

@@ -164,6 +164,7 @@ const appTaskManager = require('./apptaskmanager.js'),
eventlog = require('./eventlog.js'),
fs = require('fs'),
Location = require('./location.js'),
locks = require('./locks.js'),
logs = require('./logs.js'),
mail = require('./mail.js'),
manifestFormat = require('@cloudron/manifest-format'),
@@ -2789,6 +2790,9 @@ async function backup(app, auditSource) {
})
.catch(async (error) => {
await eventlog.add(eventlog.ACTION_APP_BACKUP_FINISH, auditSource, { app, success: false, errorMessage: error.message });
})
.finally(async () => {
await locks.releaseByTaskId(taskId);
});
await eventlog.add(eventlog.ACTION_APP_BACKUP, auditSource, { app, appId: app.id, taskId });