From ab4b8b744ae7a229e79bbdb21e0f8fca768660fa Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 28 Aug 2024 10:33:34 +0200 Subject: [PATCH] update cron job --- app/cron_dashboard.py | 5 +++-- app/primary_cron_job.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/cron_dashboard.py b/app/cron_dashboard.py index 07c6ddb..65eaa22 100644 --- a/app/cron_dashboard.py +++ b/app/cron_dashboard.py @@ -135,12 +135,13 @@ async def get_upcoming_earnings(session): 'revenueEst': revenue_est }) except Exception as e: - print('1 Upcoming Earnings:', 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[0:5] @@ -227,7 +228,7 @@ async def get_recent_dividends(session): 'updated': item['updated'] }) except Exception as e: - print('Recent Earnings:', e) + print('Recent Dividends:', e) pass except Exception as e: print(e) diff --git a/app/primary_cron_job.py b/app/primary_cron_job.py index eace0f5..2f6d946 100755 --- a/app/primary_cron_job.py +++ b/app/primary_cron_job.py @@ -580,7 +580,6 @@ schedule.every().saturday.at("05:00").do(run_threaded, run_ownership_stats).tag( schedule.every(1).minutes.do(run_threaded, run_cron_portfolio).tag('portfolio_job') schedule.every(5).minutes.do(run_threaded, run_cron_market_movers).tag('market_movers_job') -schedule.every(2).minutes.do(run_threaded, run_dashboard).tag('dashboard_job') schedule.every(30).minutes.do(run_threaded, run_dividend_list).tag('dividend_list_job') schedule.every(15).minutes.do(run_threaded, run_cron_market_news).tag('market_news_job') @@ -604,6 +603,8 @@ schedule.every(6).hours.do(run_threaded, run_analyst_rating).tag('analyst_job') schedule.every(10).seconds.do(run_threaded, run_if_not_running(run_cron_options_flow, 'options_flow_job')).tag('options_flow_job') schedule.every(10).seconds.do(run_threaded, run_if_not_running(run_cron_options_zero_dte, 'options_zero_dte_job')).tag('options_zero_dte_job') +schedule.every(2).minutes.do(run_threaded, run_dashboard).tag('dashboard_job') + # Run the scheduled jobs indefinitelyp while True: