Skip to content
Snippets Groups Projects
Commit 37f4df4a authored by Erik Reid's avatar Erik Reid
Browse files

Merge branch 'develop' of...

Merge branch 'develop' of gitlab.geant.net:live-projects/dashboardv3/inventory-provider into develop
parents 168a10e2 34e62027
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,8 @@ def after_request(response): ...@@ -137,7 +137,8 @@ def after_request(response):
return response return response
def _redis_client_proc(key_queue, value_queue, config_params, doc_type): def _redis_client_proc(
key_queue, value_queue, config_params, doc_type, use_next_redis=False):
""" """
create a local redis connection with the current db index, create a local redis connection with the current db index,
lookup the values of the keys that come from key_queue lookup the values of the keys that come from key_queue
...@@ -165,7 +166,10 @@ def _redis_client_proc(key_queue, value_queue, config_params, doc_type): ...@@ -165,7 +166,10 @@ def _redis_client_proc(key_queue, value_queue, config_params, doc_type):
return etree.XML(value) return etree.XML(value)
try: try:
r = tasks_common.get_current_redis(config_params) if use_next_redis:
r = tasks_common.get_next_redis(config_params)
else:
r = tasks_common.get_current_redis(config_params)
while True: while True:
key = key_queue.get() key = key_queue.get()
...@@ -215,7 +219,7 @@ def _load_redis_docs( ...@@ -215,7 +219,7 @@ def _load_redis_docs(
q = queue.Queue() q = queue.Queue()
t = threading.Thread( t = threading.Thread(
target=_redis_client_proc, target=_redis_client_proc,
args=[q, response_queue, config_params, doc_type]) args=[q, response_queue, config_params, doc_type, use_next_redis])
t.start() t.start()
threads.append({'thread': t, 'queue': q}) threads.append({'thread': t, 'queue': q})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment