Code review comment for lp:~florent.x/openobject-server/trunk-bug-905257-fix-reconnect

Revision history for this message
Florent (florent.x) wrote :

Before the change, "Pool.borrow" was just returning the connection from the pool (and discarding the connections marked as closed), without doing additional network roundtrips.
It does not seem to be a design flaw to check the validity of the cursor's connection in the Cursor.__init__ method, as I did in my patch.
However it does not matter really, and your proposal looks good.

I've noticed another minor issue with your patch, because the `enumerate` built-in returns an iterable:

>>> the_pool = list('Python rocks!')
>>> for idx, char in enumerate(the_pool):
... print the_pool.pop(idx),
...
P t o o k !
>>>

« Back to merge proposal