From c58fafe734a77fdff5c92bba00b38a68d3539c72 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 23 Oct 2024 20:09:20 +0200 Subject: [PATCH] update cron job --- app/cron_export_price.py | 2 +- app/primary_cron_job.py | 8 ++++++++ app/secondary_cron_job.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/cron_export_price.py b/app/cron_export_price.py index e71dfc3..0e642f1 100644 --- a/app/cron_export_price.py +++ b/app/cron_export_price.py @@ -119,7 +119,7 @@ async def run(): # List of total symbols to process total_symbols = stock_symbols # Use stock_symbols + etf_symbols if needed - chunk_size = len(total_symbols) // 500 # Divide the list into N chunks + chunk_size = len(total_symbols) #// 500 # Divide the list into N chunks chunks = [total_symbols[i:i + chunk_size] for i in range(0, len(total_symbols), chunk_size)] for chunk in tqdm(chunks): diff --git a/app/primary_cron_job.py b/app/primary_cron_job.py index 3f4d9f8..335a1d2 100755 --- a/app/primary_cron_job.py +++ b/app/primary_cron_job.py @@ -248,6 +248,12 @@ def run_dashboard(): run_command(["python3", "cron_market_movers.py"]) run_command(["python3", "cron_dashboard.py"]) + +def run_export_price(): + week = datetime.today().weekday() + if week <= 5: + run_command(["python3", "cron_export_price"]) + def run_tracker(): # Run Python scripts scripts = [ @@ -313,6 +319,8 @@ schedule.every().day.at("01:00").do(run_threaded, run_options_bubble_ticker).tag schedule.every().day.at("02:00").do(run_threaded, run_db_schedule_job) schedule.every().day.at("03:00").do(run_threaded, run_dark_pool) schedule.every().day.at("05:00").do(run_threaded, run_options_gex).tag('options_gex_job') +schedule.every().day.at("05:00").do(run_threaded, run_export_price).tag('export_price_job') + schedule.every().day.at("06:00").do(run_threaded, run_historical_price).tag('historical_job') schedule.every().day.at("06:30").do(run_threaded, run_ai_score).tag('ai_score_job') diff --git a/app/secondary_cron_job.py b/app/secondary_cron_job.py index bf06e28..26a4bac 100755 --- a/app/secondary_cron_job.py +++ b/app/secondary_cron_job.py @@ -51,7 +51,7 @@ def run_threaded(job_func): job_thread.start() -schedule.every().day.at("06:30").do(run_threaded, run_pocketbase).tag('pocketbase_job') +#schedule.every().day.at("06:30").do(run_threaded, run_pocketbase).tag('pocketbase_job') schedule.every().day.at("15:45").do(run_threaded, run_restart_cache) schedule.every(2).hours.do(run_threaded, run_json_job).tag('json_job') schedule.every(1).minutes.do(run_threaded, run_cron_price_alert).tag('price_alert_job')