Refactor report generation and logging handlers.

Introduced `CustomLogsHandler` to streamline log management and updated `ReportGenerator` to simplify report generation output. Removed unused asynchronous iterator methods, improving code clarity and reducing complexity.
This commit is contained in:
ThomasTaroni 2025-04-25 18:56:41 +02:00
parent 1dbf774d55
commit 936eb6f394
2 changed files with 5 additions and 21 deletions

View file

@ -37,7 +37,8 @@ async def get_report_endpoint(request: ReportRequest):
try:
# Call the asynchronous get_report function
generator = ReportGenerator(request.query, request.report_type)
await generator.generate_report()
custom_logs_handler = await generator.generate_report()
yield "Report generation completed successfully!\n"
except Exception as e:
yield f"Error: {str(e)}"