Skip to content

Commit

Permalink
Unify restricted use token generation and validation - #70
Browse files Browse the repository at this point in the history
  • Loading branch information
tiblu committed Jan 14, 2019
1 parent 6c1b3dc commit c064bbe
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/utils/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ var closeDb = function () {
// BUT, as in the universe of these tests there is only one instance of Sequelize, thus if I call sequelize.close() in the suiteTearDown(), next tests will fail cause they cannot get a connection.
// Sequelize has pool.min, pool.idle and pool.evict which clean up the pool, but that by design does not exit Sequelize.
// So I have 2 options: this hack or in suiteSetup each test sets a new Sequelize connection and kills it later. Right now it's the hack.
//if (!interval) {
// interval = setInterval(function () {
// if (db.connectionManager.pool._allObjects.size === 0) {
// clearInterval(interval);
// db
// .close()
// .then(function () {
// logger.info('DB connection force closed from shared.closeDb as the pool was empty.');
// });
// }
// }, 5000);
//}
if (!interval) {
interval = setInterval(function () {
if (db.connectionManager.pool._allObjects.size === 0) {
clearInterval(interval);
db
.close()
.then(function () {
logger.info('DB connection force closed from shared.closeDb as the pool was empty.');
});
}
}, 5000);
}

return Promise.resolve();
};
Expand Down

0 comments on commit c064bbe

Please sign in to comment.