johnnadratowski / golang-neo4j-bolt-driver

Golang Bolt driver for Neo4j
MIT License
213 stars 72 forks source link

Add constructor method to build pool with configurable timeouts #61

Open eldeal opened 6 years ago

eldeal commented 6 years ago

Needed to increase the timeout for all connections in a pool, so made the timeouts configurable on a pool

(a few things got picked up by the linter as well)

scott-wilson commented 6 years ago

I think the only thing we're missing is tests for the new public function, but looks good to me.

eldeal commented 6 years ago

Good point! I'm finding it difficult to get to a meaningful test as the new function and OpenPool both return interfaces so I can't inspect any of the private fields.

I've added a GetTimeout() function to the boltConn type, as this seems the clearest way of allowing the timeout to be inspected - though currently the only use for that is a test, so would understand if that makes people uneasy to have a public function specifically to facilitate testing.

Happy to change it if a clearer solution can be found!