dlapiduz/govcode.org — pull request #28 by marcesher (2014-10-25 12:57:46+00:00)
Title: Import: bad connection. Addresses #21

@dlapiduz Not sure if you want to take this one or not, because I'm not sure it'd manifest on a production system.

With #21 on my mac, I got lots of "driver: bad connection" errors during import, which resulted in a lot of missing data.

This PR limits the number of open connections to 10 and adds an index on repositories.name. The index isn't required to fix the problem but it does seem sensible to add since it's a string field and the query runs a bunch during import.

Limiting the number of open connections fixed the problem for me, at least locally.

This also enables logging, which you may or may not want. I turned it on b/c it was impossible to diagnose a) errors and b) performance problems without it.