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

catch RedisError's and reset latch status

parent 36b5f906
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@ import logging
import os
import time
from redis.exceptions import RedisError
from celery import Task, states
from celery.result import AsyncResult
......@@ -548,26 +550,30 @@ def launch_refresh_cache_all(config):
:return:
"""
_erase_next_db(config)
monitor.clear_joblog(get_current_redis(config))
update_latch_status(config, pending=True)
# TODO: [DBOARD3-242] catch exceptions & reset latch status
# first batch of subtasks: refresh cached opsdb data
subtasks = [
update_neteng_managed_device_list.apply_async(),
update_interfaces_to_services.apply_async(),
update_geant_lambdas.apply_async(),
update_circuit_hierarchy.apply_async()
]
[x.get() for x in subtasks]
# now launch the task whose only purpose is to
# act as a convenient parent for all of the remaining tasks
t = internal_refresh_phase_2.apply_async()
return t.id
try:
_erase_next_db(config)
monitor.clear_joblog(get_current_redis(config))
update_latch_status(config, pending=True)
# first batch of subtasks: refresh cached opsdb data
subtasks = [
update_neteng_managed_device_list.apply_async(),
update_interfaces_to_services.apply_async(),
update_geant_lambdas.apply_async(),
update_circuit_hierarchy.apply_async()
]
[x.get() for x in subtasks]
# now launch the task whose only purpose is to
# act as a convenient parent for all of the remaining tasks
t = internal_refresh_phase_2.apply_async()
return t.id
except RedisError:
update_latch_status(config, pending=False, failure=True)
logger.exception('error launching refresh subtasks')
raise
def _wait_for_tasks(task_ids, update_callback=lambda s: None):
......
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