Skip to content

Instantly share code, notes, and snippets.

@mesaglio
Created March 21, 2020 16:37
Show Gist options
  • Save mesaglio/0c1e23cf6bebc2d50ad539fc296291b1 to your computer and use it in GitHub Desktop.
Save mesaglio/0c1e23cf6bebc2d50ad539fc296291b1 to your computer and use it in GitHub Desktop.
var Sequelize = require('sequelize');
var pool;
module.exports = {
getPool: function() {
if (pool) {
console.log('pool viejo '); //+ pool);
return pool;
}
pool = new Sequelize('mysql://root:root@localhost:3306/pdep', {
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
}
});
console.log('Primera conexion '); //+ pool);
return pool;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment