• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

karenc / db-migrator / 195 / 2
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 26 Oct 2017 04:22PM UTC
Files 22
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Oct 2017 04:20PM UTC coverage: 96.198% (-0.7%) from 96.938%
195.2

push

travis-ci

pumazi
Explicitly close all postgres db connections

The psycopg2 db connection `with` statement does not actually close the
database connection causing lots of idle postgres connections on the
production servers.  An idle postgres connection can be found by doing
`ps aux` on the database servers, for example you will see something
like this:

```
postgres 25498  0.0  0.5 302652 10996 ?        Ss   09:31   0:00 postgres: cnxarchive cnxarchive 192.168.122.250(42646) idle
```

On http://initd.org/psycopg/docs/usage.html#with-statement

"Note that, unlike file objects or other resources, exiting the
connection’s with block doesn't close the connection but only the
transaction associated with it"

This change creates a `db_connect` function that is like
`psycopg2.connect` but closes the db connection when exiting the `with`
block.

1012 of 1052 relevant lines covered (96.2%)

0.96 hits per line

Source Files on job 195.2
  • Tree
  • List 0
  • Changed 4
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 195
  • Travis Job 195.2
  • 63e6329e on github
  • Prev Job for on master (#183.1)
  • Next Job for on master (#201.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc