diff --git a/lib/api/consumers/export-to-exploitation-db-consumer.js b/lib/api/consumers/export-to-exploitation-db-consumer.js index 9559fc7f..c7e32274 100644 --- a/lib/api/consumers/export-to-exploitation-db-consumer.js +++ b/lib/api/consumers/export-to-exploitation-db-consumer.js @@ -84,11 +84,6 @@ export default async function exportToExploitationDB({data}) { }) try { - // Then start your transaction - const transaction = await sequelize.transaction({ - isolationLevel: Transaction.ISOLATION_LEVELS.REPEATABLE_READ - }) - // Find the district const district = await District.findOne({ where: {id: districtID}, transaction, diff --git a/lib/util/sequelize.js b/lib/util/sequelize.js index b65eb6e8..f3946e92 100644 --- a/lib/util/sequelize.js +++ b/lib/util/sequelize.js @@ -4,13 +4,20 @@ const {POSTGRES_BAN_USER, POSTGRES_BAN_PASSWORD, POSTGRES_DB, POSTGRES_URL} = pr const POSTGRES_PORT = process.env.POSTGRES_PORT || 5432 // Create a new Sequelize instance +/* eslint-disable unicorn/numeric-separators-style */ export const sequelize = new Sequelize(POSTGRES_DB, POSTGRES_BAN_USER, POSTGRES_BAN_PASSWORD, { host: POSTGRES_URL, port: POSTGRES_PORT, dialect: 'postgres', - logging: false + logging: false, + pool: { + max: 20, + min: 0, + acquire: 60000, + idle: 5000 + } }) - +/* eslint-enable unicorn/numeric-separators-style */ export const District = sequelize.define('District', { id: { type: DataTypes.UUID,