Commit da538bc6 authored by root's avatar root

Close queue connection.

parent 86b9f2a0
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
# interpreted as representing official policies, either expressed # interpreted as representing official policies, either expressed
# or implied, of GRNET S.A. # or implied, of GRNET S.A.
from pithos.lib.queue import exchange_connect, exchange_send, Receipt from pithos.lib.queue import exchange_connect, exchange_send, exchange_close, Receipt
class Queue(object): class Queue(object):
...@@ -48,3 +48,6 @@ class Queue(object): ...@@ -48,3 +48,6 @@ class Queue(object):
def send(self, user, resource, value, details): def send(self, user, resource, value, details):
body = Receipt(self.client_id, user, resource, value, details).format() body = Receipt(self.client_id, user, resource, value, details).format()
exchange_send(self.conn, self.message_key, body) exchange_send(self.conn, self.message_key, body)
def close(self):
exchange_close(self.conn)
...@@ -134,11 +134,15 @@ class ModularBackend(BaseBackend): ...@@ -134,11 +134,15 @@ class ModularBackend(BaseBackend):
class NoQueue: class NoQueue:
def send(self, *args): def send(self, *args):
pass pass
def close(self):
pass
self.queue = NoQueue() self.queue = NoQueue()
def close(self): def close(self):
self.wrapper.close() self.wrapper.close()
self.queue.close()
@backend_method @backend_method
def list_accounts(self, user, marker=None, limit=10000): def list_accounts(self, user, marker=None, limit=10000):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment