From 2c8c66677f0856acbbfb7b99165c6070a4b3ab04 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 19 Oct 2024 15:33:37 +0200 Subject: [PATCH] bugfixing --- app/cron_company_news.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/cron_company_news.py b/app/cron_company_news.py index 7ca4299..0747118 100644 --- a/app/cron_company_news.py +++ b/app/cron_company_news.py @@ -31,7 +31,7 @@ async def filter_and_deduplicate(data, excluded_domains=None, deduplicate_key='t return filtered_data -async def save_quote_as_json(symbol, data): +async def save_json(symbol, data): """ Save data as JSON in a batch to reduce disk I/O """ @@ -74,7 +74,7 @@ async def process_chunk(session, chunk): filtered_data = [item for item in data if item['symbol'] == symbol] filtered_data = await filter_and_deduplicate(filtered_data) if filtered_data: - tasks.append(save_quote_as_json(symbol, filtered_data)) + tasks.append(save_json(symbol, filtered_data)) if tasks: await asyncio.gather(*tasks)