Ensure default minimum memory limit

This commit is contained in:
Johannes Zellner
2016-02-10 12:25:24 +01:00
parent 19cbd1f394
commit 5ea81d0fd3

View File

@@ -356,7 +356,7 @@ function install(appId, appStoreId, manifest, location, portBindings, accessRest
error = validateAccessRestriction(accessRestriction);
if (error) return callback(new AppsError(AppsError.BAD_FIELD, error.message));
var memoryLimit = manifest.memoryLimit <= 268435456 ? 268435456 : manifest.memoryLimit; // 256mb
var memoryLimit = (!manifest.memoryLimit || manifest.memoryLimit <= 268435456) ? 268435456 : manifest.memoryLimit; // 256mb
// singleUser mode requires accessRestriction to contain exactly one user
if (manifest.singleUser && accessRestriction === null) return callback(new AppsError(AppsError.USER_REQUIRED));