dlapiduz / govcode.org

Government Open Source Project Explorer
MIT License
63 stars 20 forks source link

Import: bad connection. Addresses #21 #28

Closed marcesher closed 9 years ago

marcesher commented 9 years ago

@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.

dlapiduz commented 9 years ago

This problem doesn't really happen in production since it is mostly a Mac OS issue but glad you fixed it!