diff --git a/app/main.py b/app/main.py index aa8bca0..2305de9 100755 --- a/app/main.py +++ b/app/main.py @@ -3685,7 +3685,7 @@ async def get_sector_overview(data: TickerData, api_key: str = Security(get_api_ compressed_data = gzip.compress(data) redis_client.set(cache_key, compressed_data) - redis_client.expire(cache_key,3600*3600) + redis_client.expire(cache_key,60*15) return StreamingResponse( io.BytesIO(compressed_data), diff --git a/app/primary_cron_job.py b/app/primary_cron_job.py index a6ad872..c5d2a3f 100755 --- a/app/primary_cron_job.py +++ b/app/primary_cron_job.py @@ -126,6 +126,17 @@ def run_cron_sector(): ] run_command(command) +def run_cron_industry(): + week = datetime.today().weekday() + if week <= 5: + run_command(["python3", "cron_industry.py"]) + command = [ + "sudo", "rsync", "-avz", "-e", "ssh", + "/root/backend/app/json/industry", + f"root@{useast_ip_address}:/root/backend/app/json" + ] + run_command(command) + def run_analyst_estimate(): week = datetime.today().weekday() if week <= 5: @@ -617,6 +628,8 @@ schedule.every(5).minutes.do(run_threaded, run_cron_market_movers).tag('market_m 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') +schedule.every(15).minutes.do(run_threaded, run_cron_industry).tag('industry_job') + schedule.every(10).minutes.do(run_threaded, run_one_day_price).tag('one_day_price_job') schedule.every(15).minutes.do(run_threaded, run_cron_heatmap).tag('heatmap_job')