From ab02ac22cd6062a50d9fbe6b44cc10e68f2b3f9d Mon Sep 17 00:00:00 2001 From: jbphet Date: Mon, 25 Nov 2019 15:37:46 -0700 Subject: [PATCH] improved info message for pool test, minor cleanup, see #167 and #208 --- js/configurePreferences.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/js/configurePreferences.js b/js/configurePreferences.js index b66b0e5e..33c4974a 100644 --- a/js/configurePreferences.js +++ b/js/configurePreferences.js @@ -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 );