service: add memorySwap to configure route
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user