Could you use a loop instead of recursing? I can think of two reasons to change it:

1)    Would save setting up a connection again
2)    Ruby [doesn't do tail-call optimization](http://stackoverflow.com/questions/824562/does-ruby-perform-tail-call-optimization)