Skip to content

Commit

Permalink
Removes log.fatal from recoverable failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-afedorov committed Dec 6, 2018
1 parent 05d7ffe commit 6fa2af3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/runners/alert_queries_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ def log_failure(ctx, query_name, e, event_data=None, description=None):
})]
try:
log_alerts(ctx, alerts)
log.fatal("Query failure successfully logged", e)
pass
log.info("Query failure logged.", e)

except Exception as e:
log.fatal("Failed to log query failure", e)
pass


def snowalert_query(query_name: str):
Expand All @@ -144,10 +143,9 @@ def snowalert_query(query_name: str):
log_failure(ctx, query_name, e)
log.metadata_fill(metadata, status='failure', exception=e)
RUN_METADATA['QUERY_HISTORY'].append(metadata)
pass

else:
log.info(f"Query {query_name} failed to run, retrying...")
continue

log.metadata_fill(metadata, status='success', rows=ctx.cursor().rowcount)
RUN_METADATA['QUERY_HISTORY'].append(metadata)
Expand Down

0 comments on commit 6fa2af3

Please sign in to comment.