diff --git a/src/database.js b/src/database.js index 167a16a2c..142c238ab 100644 --- a/src/database.js +++ b/src/database.js @@ -113,10 +113,7 @@ function beginTransaction(callback) { if (gConnectionPool === null) return callback(new BoxError(BoxError.DATABASE_ERROR, 'No database connection pool.')); gConnectionPool.getConnection(function (error, connection) { - if (error) { - console.error('Unable to get connection to database. Try again in a bit.', error.message); - return setTimeout(beginTransaction.bind(null, callback), 1000); - } + if (error) return callback(error); connection.beginTransaction(function (error) { if (error) return callback(error);