Skip to content

A library for waiting for mongoDB or redis to come online

Notifications You must be signed in to change notification settings

grumpitect/waitForIt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A library for waiting for mongoDB or redis to come online

This small library is for waiting for database services to come online, it is useful for applications that cannot run if the database is not online. This will specially come in handy when using containers (like Docker containers) to run the project because you don't know if the database containers are online or not.

example usage:

// The options parameter will be passed to the underlying driver.

await waitforit.mongo(mongoUrl, {
  retryTimeout: 2000, // The time to wait before every retry - default is 2000 milliseconds
  timeout = -1, // A timeout after which the code gives up with an exception - default is -1 which means no timeout
});

or

await waitforit.redis({
  host,
  port,
});

About

A library for waiting for mongoDB or redis to come online

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published