mirror of https://github.com/celery/kombu.git
small improvement, connection can be reached using the database instance
This commit is contained in:
parent
6b06d1338b
commit
795c8aeede
|
@ -25,7 +25,6 @@ __author__ = "Flavio [FlaPer87] Percoco Premoli <flaper87@flaper87.org>"
|
||||||
|
|
||||||
class Channel(virtual.Channel):
|
class Channel(virtual.Channel):
|
||||||
_client = None
|
_client = None
|
||||||
_mongoconn = None
|
|
||||||
|
|
||||||
def _new_queue(self, queue, **kwargs):
|
def _new_queue(self, queue, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
@ -51,8 +50,7 @@ class Channel(virtual.Channel):
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
super(Channel, self).close()
|
super(Channel, self).close()
|
||||||
self._mongoconn.end_request()
|
self.client.database.connection.end_request()
|
||||||
self._mongoconn = None
|
|
||||||
|
|
||||||
def _open(self):
|
def _open(self):
|
||||||
conninfo = self.connection.client
|
conninfo = self.connection.client
|
||||||
|
@ -63,7 +61,6 @@ class Channel(virtual.Channel):
|
||||||
database = getattr(mongoconn, dbname)
|
database = getattr(mongoconn, dbname)
|
||||||
col = database.messages
|
col = database.messages
|
||||||
col.ensure_index([("queue", 1)])
|
col.ensure_index([("queue", 1)])
|
||||||
self._mongoconn = mongoconn
|
|
||||||
return col
|
return col
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue