Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jugurtha/integrer les contours postaux dans pg #444

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/api/consumers/export-to-exploitation-db-consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 9 additions & 2 deletions lib/util/sequelize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading