mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Improving logging around failed scheduled reports (#19924)
This commit is contained in:
parent
90130e4b4f
commit
e1f53f2a2c
@ -72,6 +72,7 @@ def scheduler() -> None:
|
|||||||
|
|
||||||
@celery_app.task(name="reports.execute")
|
@celery_app.task(name="reports.execute")
|
||||||
def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
|
def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
|
||||||
|
task_id = None
|
||||||
try:
|
try:
|
||||||
task_id = execute.request.id
|
task_id = execute.request.id
|
||||||
scheduled_dttm_ = parser.parse(scheduled_dttm)
|
scheduled_dttm_ = parser.parse(scheduled_dttm)
|
||||||
@ -80,12 +81,14 @@ def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
|
|||||||
report_schedule_id,
|
report_schedule_id,
|
||||||
scheduled_dttm_,
|
scheduled_dttm_,
|
||||||
).run()
|
).run()
|
||||||
except ReportScheduleUnexpectedError as ex:
|
except ReportScheduleUnexpectedError:
|
||||||
logger.error(
|
logger.exception(
|
||||||
"An unexpected occurred while executing the report: %s", ex, exc_info=True
|
"An unexpected occurred while executing the report: %s", task_id
|
||||||
|
)
|
||||||
|
except CommandException:
|
||||||
|
logger.exception(
|
||||||
|
"A downstream exception occurred while generating" " a report: %s", task_id
|
||||||
)
|
)
|
||||||
except CommandException as ex:
|
|
||||||
logger.info("Report state: %s", ex)
|
|
||||||
|
|
||||||
|
|
||||||
@celery_app.task(name="reports.prune_log")
|
@celery_app.task(name="reports.prune_log")
|
||||||
@ -95,8 +98,4 @@ def prune_log() -> None:
|
|||||||
except SoftTimeLimitExceeded as ex:
|
except SoftTimeLimitExceeded as ex:
|
||||||
logger.warning("A timeout occurred while pruning report schedule logs: %s", ex)
|
logger.warning("A timeout occurred while pruning report schedule logs: %s", ex)
|
||||||
except CommandException as ex:
|
except CommandException as ex:
|
||||||
logger.error(
|
logger.exception("An exception occurred while pruning report schedule logs")
|
||||||
"An exception occurred while pruning report schedule logs: %s",
|
|
||||||
ex,
|
|
||||||
exc_info=True,
|
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user