Skip to content

Commit

Permalink
added logging to execute task
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Oct 14, 2022
1 parent 2398986 commit 1c0a622
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/tasks/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def scheduler() -> None:
)


@celery_app.task(name="reports.execute")
@celery_app.task(name="reports.execute", bind=True)
def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
task_id = None
try:
Expand All @@ -90,10 +90,12 @@ def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
logger.exception(
"An unexpected occurred while executing the report: %s", task_id
)
execute.update_state(state="FAILURE")
except CommandException:
logger.exception(
"A downstream exception occurred while generating" " a report: %s", task_id
)
execute.update_state(state="FAILURE")


@celery_app.task(name="reports.prune_log")
Expand Down

0 comments on commit 1c0a622

Please sign in to comment.