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

re-use redis connection

parent 4ecc9abc
No related branches found
No related tags found
No related merge requests found
......@@ -23,9 +23,10 @@ def update():
force = False
config = current_app.config['INVENTORY_PROVIDER_CONFIG']
r = get_current_redis(config)
if not force:
latch = get_latch(get_current_redis(config))
latch = get_latch(r)
if latch and latch['pending']:
return Response(
response='an update is already in progress',
......@@ -34,7 +35,6 @@ def update():
phase2_task_id = worker.launch_refresh_cache_all(config)
r = common.get_current_redis()
r.set('classifier-cache:update-task-id', phase2_task_id.encode('utf-8'))
return jsonify({'task id': phase2_task_id})
......
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