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

allow joblog cached response to be ignored when searching

parent 8d6029ff
No related branches found
No related tags found
No related merge requests found
......@@ -164,7 +164,7 @@ def _redis_client_proc(key_queue, value_queue, config_params):
value_queue.put(None)
def load_task_log(config_params):
def load_task_log(config_params, ignored_keys=[]):
"""
load the task log in a formatted dictionary:
keys are task uuid's
......@@ -176,6 +176,7 @@ def load_task_log(config_params):
the redis master the cumulative latency causes nginx/gunicorn timeouts
:param config_params: app config
:param ignored_keys: list of keys to ignore if found
:return:
"""
response_queue = queue.Queue()
......@@ -191,8 +192,13 @@ def load_task_log(config_params):
r = get_current_redis(config_params)
for k in r.scan_iter('joblog:*'):
k = k.decode('utf-8')
if k in ignored_keys:
logger.debug('ignoring key: {k}')
continue
t = random.choice(threads)
t['queue'].put(k.decode('utf-8'))
t['queue'].put(k)
# tell all threads there are no more keys coming
for t in threads:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment