Skip to content

Commit

Permalink
Quickfix for bgBouncer (#71)
Browse files Browse the repository at this point in the history
Co-authored-by: peb-adr <adrichter97@gmail.com>
  • Loading branch information
ostcar and peb-adr committed Nov 25, 2021
1 parent 31ce9ac commit e3d1c02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/backends/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ func New(ctx context.Context, url string) (*Backend, error) {
return nil, fmt.Errorf("invalid connection url: %w", err)
}
conf.LazyConnect = true

// Fix issue with gbBouncer. The documentation says, that this make the
// connection slower. We have to test the performance. Maybe it is better to
// remove the connection pool here or not use bgBouncer at all.
//
// See https://github.com/OpenSlides/openslides-vote-service/pull/66
conf.ConnConfig.PreferSimpleProtocol = true

pool, err := pgxpool.ConnectConfig(ctx, conf)
if err != nil {
return nil, fmt.Errorf("creating connection pool: %w", err)
Expand Down

0 comments on commit e3d1c02

Please sign in to comment.