Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
This PR introduces Elasticsearch/OpenSearch health and node checks.
They need to be called manually, but they will help with determining if the cluster is good for writes/reads.
How Has This Been Tested?
Jest.
Usage
// Configure the utility.
const waitUntilHealthy = createWaitUntilHealthy(client, {
minStatus: ElasticsearchCatHealthStatus.Yellow,
maxProcessorPercent: 101,
maxWaitingTime: 30,
waitingTimeStep: 5,
maxRamPercent: 101
});
// Wait until the cluster is healthy.
// It will throw an error on Abort and on Timeout (when maxWaitingTime is hit).
const { runs, runningTime } = await waitUntilHealthy.wait({
async onUnhealthy(params) {
const { runs, startedAt, mustEndAt, waitingTimeStep } = params;
},
async onTimeout(params) {
const { runs, startedAt, mustEndAt, waitingTimeStep } = params;
// log some info?
}
});
// continue with your regular code
Changes
This PR introduces Elasticsearch/OpenSearch health and node checks. They need to be called manually, but they will help with determining if the cluster is good for writes/reads.
How Has This Been Tested?
Jest.
Usage