backups: move limits into a sub object

fixes #817
This commit is contained in:
Girish Ramakrishnan
2023-07-13 11:50:57 +05:30
parent 1a5cbfb2a1
commit c86059e070
13 changed files with 66 additions and 68 deletions
+1 -1
View File
@@ -1206,7 +1206,7 @@ async function scheduleTask(appId, installationState, taskId, auditSource) {
let memoryLimit = 400;
if (installationState === exports.ISTATE_PENDING_BACKUP || installationState === exports.ISTATE_PENDING_CLONE || installationState === exports.ISTATE_PENDING_RESTORE
|| installationState === exports.ISTATE_PENDING_IMPORT || installationState === exports.ISTATE_PENDING_UPDATE) {
memoryLimit = 'memoryLimit' in backupConfig ? Math.max(backupConfig.memoryLimit/1024/1024, 400) : 400;
memoryLimit = backupConfig.limits?.memoryLimit ? Math.max(backupConfig.limits.memoryLimit/1024/1024, 400) : 400;
} else if (installationState === exports.ISTATE_PENDING_DATA_DIR_MIGRATION) {
memoryLimit = 1024; // cp takes more memory than we think
}