Skip to content

Commit

Permalink
core | wrap get_split_rule_info by try-except
Browse files Browse the repository at this point in the history
  • Loading branch information
tkorchug committed Apr 24, 2023
1 parent 6214635 commit 3c6a3f1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5859,12 +5859,14 @@ def taskInfo(request, jeditaskid=0):
taskrec['brokerage'] = 'prod_brokerage' if taskrec['tasktype'] == 'prod' else 'analy_brokerage'
if settings.DEPLOYMENT == 'ORACLE_ATLAS':
taskrec['slice'] = get_prod_slice_by_taskid(jeditaskid) if taskrec['tasktype'] == 'prod' else None

connection = create_es_connection()
split_rule = get_split_rule_info(connection, jeditaskid)
if len(split_rule) > 0:
info['split_rule'] = {}
info['split_rule']['messages'] = split_rule
try:
connection = create_es_connection()
split_rule = get_split_rule_info(connection, jeditaskid)
if len(split_rule) > 0:
info['split_rule'] = {}
info['split_rule']['messages'] = split_rule
except Exception as e:
_logger.exception('Failed to get split rule info for task from elasticSearch with:\n{}'.format(e))

# datetime type -> str in order to avoid encoding errors in template
datetime_task_param_names = ['creationdate', 'modificationtime', 'starttime', 'statechangetime', 'ttcrequested']
Expand Down

0 comments on commit 3c6a3f1

Please sign in to comment.