service: add memorySwap to configure route

This commit is contained in:
Girish Ramakrishnan
2020-01-28 13:33:43 -08:00
parent d649a470f9
commit 3929b3ca0a
2 changed files with 2 additions and 2 deletions

View File

@@ -624,7 +624,6 @@ function updateServiceConfig(platformConfig, callback) {
debug('updateServiceConfig: %j', platformConfig);
// TODO: this should possibly also rollback memory to default
async.eachSeries([ 'mysql', 'postgresql', 'mail', 'mongodb', 'graphite' ], function iterator(serviceName, iteratorCallback) {
const containerConfig = platformConfig[serviceName];
let memory, memorySwap;

View File

@@ -40,10 +40,11 @@ function configure(req, res, next) {
assert.strictEqual(typeof req.params.service, 'string');
if (typeof req.body.memory !== 'number') return next(new HttpError(400, 'memory must be a number'));
if (typeof req.body.memorySwap !== 'number') return next(new HttpError(400, 'memorySwap must be a number'));
const data = {
memory: req.body.memory,
memorySwap: req.body.memory * 2
memorySwap: req.body.memorySwap
};
addons.configureService(req.params.service, data, function (error) {