Skip to content

Node script to wait for Elasticsearch to be ready for use

Notifications You must be signed in to change notification settings

fintechstudios/wait-for-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

@fintechstudios/wait-for-elasticsearch

Waits for Elasticsearch to be ready to use.

Usage

In all usages, if the host is not specified it will be read from the ES_HOST environment variable.

CLI

waitForEs [host=$ES_HOST] [maxRetries=10] [msBetweenRetries=2000]

$ waitForES http://localhost:9200
Waiting for shards to settle on http://localhost:9200
Elasticsearch on http://localhost:9200 is ready (took 0.018s)

API

waitForES({ [host=$ES_HOST], [maxRetries=10], [msBetweenRetries=2000] })

const waitForES = require('@fintechstudios/wait-for-elasticsearch');

async main() {
  await waitForES({ host: 'http://localhost:9200' });
}

About

Node script to wait for Elasticsearch to be ready for use

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published