operator: add a limits route to determine max app resource limits

This commit is contained in:
Girish Ramakrishnan
2021-09-21 22:29:19 -07:00
parent 214540ebfa
commit 629908eb4c
3 changed files with 22 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ exports = module.exports = {
getDataDir,
getIcon,
getMemoryLimit,
getLimits,
listEventlog,
@@ -160,6 +161,7 @@ const appstore = require('./appstore.js'),
spawn = require('child_process').spawn,
split = require('split'),
superagent = require('superagent'),
system = require('./system.js'),
tasks = require('./tasks.js'),
TransformStream = require('stream').Transform,
users = require('./users.js'),
@@ -468,6 +470,14 @@ async function getIcon(app, options) {
return null;
}
async function getLimits(app) {
assert.strictEqual(typeof app, 'object');
return {
memory: await system.getMemory()
};
}
function getMemoryLimit(app) {
assert.strictEqual(typeof app, 'object');