Permalink
Browse files

Close connection when it is removed from a pool

  • Loading branch information...
1 parent f714870 commit 52285671c68e50be2f58bceffae0c5d793ae0f43 @mloughran mloughran committed Oct 21, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/beanstalk-client/connection.rb
@@ -317,7 +317,9 @@ def list_tubes_watched(*args)
end
def remove(conn)
- @connections.delete(conn.addr)
+ connection = @connections.delete(conn.addr)
+ connection.close if connection
+ connection
end
def close

0 comments on commit 5228567

Please sign in to comment.