support: add route to repair apps

This commit is contained in:
Girish Ramakrishnan
2024-07-11 18:30:29 +02:00
parent 8754a208b1
commit 0bab0ed748
3 changed files with 27 additions and 1 deletions

View File

@@ -83,6 +83,7 @@ exports = module.exports = {
restoreApps,
configureApps,
repairApps,
schedulePendingTasks,
restartAppsUsingAddons,
@@ -2197,6 +2198,17 @@ async function repair(app, data, auditSource) {
return { taskId };
}
async function repairApps(auditSource) {
assert.strictEqual(typeof auditSource, 'object');
const apps = await list();
for (const app of apps) {
if (app.installationState !== exports.ISTATE_ERROR) continue;
await repair(app, { /* data */}, auditSource);
}
}
async function restore(app, backupId, auditSource) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof backupId, 'string');