Skip to content

Commit

Permalink
improved info message for pool test, minor cleanup, see #167 and #208
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Nov 25, 2019
1 parent 57ace39 commit ab02ac2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions js/configurePreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,8 @@ module.exports = async function() {
preferences.productionServerName = preferences.productionServerName || 'phet-server.int.colorado.edu';

// check that the DB server is running and that a basic query can be performed
winston.log( 'info', 'testing database connection (results will likely be several log entries after this one)' );
// !!! THIS WORKS
// const pool = new Pool();
// pool.query( 'SELECT NOW()', ( err, res ) => {
// if ( err ) {
// winston.log( 'error', 'database connection failed, short term string storage will not work, err = ' + err );
// }
// else {
// winston.log( 'info', 'database test using SELECT NOW() succeeded, now = ' + res.rows[ 0 ].now );
// }
// } );

winston.log( 'info', 'testing database connection (results may be several log entries after this one)' );
const pool = new Pool();

try {
const { rows } = await pool.query( 'SELECT NOW()' );
winston.log( 'info', 'database test using SELECT NOW() succeeded, now = ' + rows[ 0 ].now );
Expand Down

0 comments on commit ab02ac2

Please sign in to comment.