Ensure we never go below 256mb memoryLimit

This commit is contained in:
Johannes Zellner
2016-02-05 15:51:01 +01:00
parent 1b7265f866
commit 19cbd1f394
2 changed files with 2 additions and 1 deletions
+1 -1
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; // 265mb
var 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));