The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/ee/lib/misc/fetchAppsStatusFromCluster.ts

24 lines
572 B

import { Apps } from '@rocket.chat/core-services';
import { isRunningMs } from '../../../server/lib/isRunningMs';
import { Instance } from '../../server/sdk';
export async function fetchAppsStatusFromCluster() {
const appsStatus = isRunningMs() ? await Apps.getAppsStatusInNodes() : await Instance.getAppsStatusInInstances();
Object.values(appsStatus).forEach((instances) =>
instances.sort((a, b) => {
if (a.instanceId > b.instanceId) {
return 1;
}
if (a.instanceId < b.instanceId) {
return -1;
}
return 0;
}),
);
return appsStatus;
}