From e7b85f37ac56bfce938cd2afcff80a3662786cd5 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Tue, 27 Aug 2024 22:16:58 +0200 Subject: [PATCH] update borrowed share --- app/cron_borrowed_share.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/cron_borrowed_share.py b/app/cron_borrowed_share.py index a552971..169c6ed 100644 --- a/app/cron_borrowed_share.py +++ b/app/cron_borrowed_share.py @@ -53,7 +53,7 @@ async def run(): con.close() etf_con.close() - total_symbols = stocks_symbols #['AAPL', 'NVDA', 'GME','PLTR','AMC'] #stocks_symbols + etf_symbols + total_symbols = stocks_symbols #+ etf_symbols async with aiohttp.ClientSession() as session: tasks = [] @@ -61,11 +61,11 @@ async def run(): tasks.append(process_ticker(ticker)) # Run tasks concurrently in batches to avoid too many open connections - batch_size = 3 # Adjust based on your system's capacity + batch_size = 1 # Adjust based on your system's capacity for i in tqdm(range(0, len(tasks), batch_size)): batch = tasks[i:i + batch_size] await asyncio.gather(*batch) - await asyncio.sleep(60) + await asyncio.sleep(5) if __name__ == "__main__": try: