Skip to content

Commit 2f53dc2

Browse files
committed
consumder_thread.wait()
Change-Id: Ia4275c9e911e36c1ea3fd409c43787f4ec1e6ab5
1 parent 2c237b5 commit 2f53dc2

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

billingstack/biller/service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def start(self):
4646
self.storage_conn = get_connection('biller')
4747
super(Service, self).start()
4848

49+
def wait(self):
50+
super(Service, self).wait()
51+
self.conn.consumer_thread.wait()
52+
4953
def create_invoice_state(self, ctxt, values):
5054
return self.storage_conn.create_invoice_state(ctxt, values)
5155

billingstack/central/service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def start(self):
4444
self.storage_conn = get_connection('central')
4545
super(Service, self).start()
4646

47+
def wait(self):
48+
super(Service, self).wait()
49+
self.conn.consumer_thread.wait()
50+
4751
def __getattr__(self, name):
4852
"""
4953
Proxy onto the storage api if there is no local method present..

billingstack/collector/service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def __init__(self, *args, **kwargs):
4848
# Get a storage connection
4949
self.central_api = CentralAPI()
5050

51+
def wait(self):
52+
super(Service, self).wait()
53+
self.conn.consumer_thread.wait()
54+
5155
def get_pg_provider(self, ctxt, pg_info):
5256
"""
5357
Work out a PGC config either from pg_info or via ctxt fetching it

billingstack/rater/service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def start(self):
5050
self.storage_conn = get_connection('rater')
5151
super(Service, self).start()
5252

53+
def wait(self):
54+
super(Service, self).wait()
55+
self.conn.consumer_thread.wait()
56+
5357
def create_usage(self, ctxt, values):
5458
return self.storage_conn.create_usage(ctxt, values)
5559

0 commit comments

Comments
 (0)