From 795c8aeedeffe31aa8d7e7c9e63ec36fdf12d16b Mon Sep 17 00:00:00 2001 From: Flavio Percoco Premoli Date: Fri, 12 Nov 2010 19:58:01 +0100 Subject: [PATCH] small improvement, connection can be reached using the database instance --- kombu/transport/mongodb.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kombu/transport/mongodb.py b/kombu/transport/mongodb.py index 497a5141..f150b39a 100644 --- a/kombu/transport/mongodb.py +++ b/kombu/transport/mongodb.py @@ -25,7 +25,6 @@ __author__ = "Flavio [FlaPer87] Percoco Premoli " class Channel(virtual.Channel): _client = None - _mongoconn = None def _new_queue(self, queue, **kwargs): pass @@ -51,8 +50,7 @@ class Channel(virtual.Channel): def close(self): super(Channel, self).close() - self._mongoconn.end_request() - self._mongoconn = None + self.client.database.connection.end_request() def _open(self): conninfo = self.connection.client @@ -63,7 +61,6 @@ class Channel(virtual.Channel): database = getattr(mongoconn, dbname) col = database.messages col.ensure_index([("queue", 1)]) - self._mongoconn = mongoconn return col @property