def test_prune_log_soft_time_out(bulk_delete_logs, create_report_email_dashboard): from celery.exceptions import SoftTimeLimitExceeded from datetime import datetime, timedelta bulk_delete_logs.side_effect = SoftTimeLimitExceeded() with pytest.raises(SoftTimeLimitExceeded) as excinfo: AsyncPruneReportScheduleLogCommand().run() assert str(excinfo.value) == "SoftTimeLimitExceeded()"
def prune_log() -> None: try: AsyncPruneReportScheduleLogCommand().run() except SoftTimeLimitExceeded as ex: logger.warning( "A timeout occurred while pruning report schedule logs: %s", ex) except CommandException as ex: logger.exception( "An exception occurred while pruning report schedule logs")
def prune_log() -> None: try: AsyncPruneReportScheduleLogCommand().run() except CommandException as ex: logger.error("An exception occurred while pruning report schedule logs: %s", ex)