From 543cc931f0b83a52b1dcf470dd03a4cca7e70309 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 25 Jan 2025 22:03:25 +0100 Subject: [PATCH] bugfixing --- app/cron_options_single_contract.py | 5 ++--- app/primary_cron_job.py | 12 +++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/cron_options_single_contract.py b/app/cron_options_single_contract.py index e56e1ed..5255c3b 100644 --- a/app/cron_options_single_contract.py +++ b/app/cron_options_single_contract.py @@ -274,7 +274,6 @@ def get_total_symbols(): return stocks_symbols + etf_symbols - def get_expiration_date(contract_id): # Extract the date part (YYMMDD) from the contract ID date_str = contract_id[2:8] @@ -346,8 +345,8 @@ async def main(): total_symbols = get_total_symbols() # Split the symbols into chunks of 2 - for i in tqdm(range(0, len(total_symbols), 4)): - symbols_chunk = total_symbols[i:i+4] + for i in tqdm(range(0, len(total_symbols), 2)): + symbols_chunk = total_symbols[i:i+2] # Run the symbols in the chunk concurrently await asyncio.gather(*[process_symbol(symbol) for symbol in symbols_chunk]) diff --git a/app/primary_cron_job.py b/app/primary_cron_job.py index 7c98d88..f8ee1a2 100755 --- a/app/primary_cron_job.py +++ b/app/primary_cron_job.py @@ -228,10 +228,6 @@ def run_sec_filings(): if week <= 4: run_command(["python3", "cron_sec_filings.py"]) -def run_executive(): - week = datetime.today().weekday() - if week <= 4: - run_command(["python3", "cron_executive.py"]) def run_analyst_rating(): week = datetime.today().weekday() @@ -347,7 +343,11 @@ def run_economy_indicator(): def run_ai_score(): - run_command(["python3", "cron_ai_score.py"]) + now = datetime.now(ny_tz) + week = now.weekday() + if week == 5: + run_command(["python3", "cron_ai_score.py"]) + run_command(["python3", "cron_stockdeck.py"]) run_command(["python3", "restart_json.py"]) run_command(["python3", "cron_statistics.py"]) @@ -381,8 +381,6 @@ schedule.every().day.at("10:00").do(run_threaded, run_fda_calendar).tag('fda_job -#schedule.every().day.at("10:30").do(run_threaded, run_sec_filings).tag('sec_filings_job') -#schedule.every().day.at("11:00").do(run_threaded, run_executive).tag('executive_job') schedule.every().day.at("12:00").do(run_threaded, run_market_cap).tag('market_cap_job') #schedule.every().day.at("05:00").do(run_threaded, run_implied_volatility).tag('implied_volatility_job')