services: send the default memory limit
This commit is contained in:
@@ -383,7 +383,7 @@ async function getServiceStatus(id) {
|
||||
throw new BoxError(BoxError.NOT_FOUND, 'Service not found');
|
||||
}
|
||||
|
||||
const tmp = {
|
||||
const result = {
|
||||
name: name,
|
||||
status: null,
|
||||
memoryUsed: 0,
|
||||
@@ -393,20 +393,21 @@ async function getServiceStatus(id) {
|
||||
config: {}
|
||||
};
|
||||
|
||||
const result = await containerStatusFunc();
|
||||
tmp.status = result.status;
|
||||
tmp.memoryUsed = result.memoryUsed;
|
||||
tmp.memoryPercent = result.memoryPercent;
|
||||
tmp.error = result.error || null;
|
||||
tmp.healthcheck = result.healthcheck || null;
|
||||
const status = await containerStatusFunc();
|
||||
result.status = status.status;
|
||||
result.memoryUsed = status.memoryUsed;
|
||||
result.memoryPercent = status.memoryPercent;
|
||||
result.defaultMemoryLimit = service.defaultMemoryLimit;
|
||||
result.error = status.error || null;
|
||||
result.healthcheck = status.healthcheck || null;
|
||||
|
||||
tmp.config = await getServiceConfig(id);
|
||||
result.config = await getServiceConfig(id);
|
||||
|
||||
if (!tmp.config.memoryLimit && service.defaultMemoryLimit) {
|
||||
tmp.config.memoryLimit = service.defaultMemoryLimit;
|
||||
if (!result.config.memoryLimit && service.defaultMemoryLimit) {
|
||||
result.config.memoryLimit = service.defaultMemoryLimit;
|
||||
}
|
||||
|
||||
return tmp;
|
||||
return result;
|
||||
}
|
||||
|
||||
async function configureService(id, data, auditSource) {
|
||||
|
||||
Reference in New Issue
Block a user