From 813b506a751a14ce4105d778dff8938737867535 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 30 Oct 2024 10:04:20 +0100 Subject: [PATCH] bugfixing --- app/cron_dashboard.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/cron_dashboard.py b/app/cron_dashboard.py index cb2123d..981a087 100644 --- a/app/cron_dashboard.py +++ b/app/cron_dashboard.py @@ -167,15 +167,18 @@ async def get_upcoming_earnings(session, end_date): except Exception as e: print('Upcoming Earnings:', e) pass - res_list = remove_duplicates(res_list) - res_list.sort(key=lambda x: x['marketCap'], reverse=True) - - res_list = [{k: v for k, v in d.items() if k != 'marketCap'} for d in res_list] - except Exception as e: print(e) pass - return res_list[:10] + try: + res_list = remove_duplicates(res_list) + res_list.sort(key=lambda x: x['marketCap'], reverse=True) + #res_list = [{k: v for k, v in d.items() if k != 'marketCap'} for d in res_list] + return res_list[:10] + except: + return [] + + async def get_recent_earnings(session):