src/tiler/healthCheck.js
/**
 * Attempts to connect to a PostgreSQL database, providing the
 * callback with the error object.
 *
 * The error object is the second callback argument because
 * error objects in the first argument cause Step to short
 * circuit. In the case of a health check, we want all
 * errors.
 *
 * @param {string} host
 * @param {string} port
 * @param {string} user
 * @param {string} password
 * @param {string} database
 * @param {function} callback
 */
Attempts to connect to a PostgreSQL database, providing the
callback with the error object.

The error object is the second callback argument because
error objects in the first argument cause Step to short
circuit. In the case of a health check, we want all
errors.


Attempts to connect to a PostgreSQL database providing the callback with the error object . The error object is the second callback argument because error objects in the first argument cause Step to short circuit . In the case of a health check we want all errors .
function checkPostgres(host, port, user, password, database, callback) {
  var conString = ['postgres://', user, ':', password, '@', host, '/', database].join('');
  var client = new Pg.Client(conString);
  client.connect(function(err) {
    client.end();
    callback(null, err);
  });
}
function checkPostgres ( host , port , user , password , database , callback ) { var conString = [ 'postgres://' , user , ':' , password , '@' , host , '/' , database ] . join ( '' ) ; var client = new Pg . Client ( conString ) ; client . connect ( function ( err ) { client . end ( ) ; callback ( null , err ) ; } ) ; }
Attempts to connect to a PostgreSQL database, providing the
 callback with the error object.
Attempts to connect to a PostgreSQL database providing the callback with the error object .