From ca820c93368adfa052c59a73f570362559eacf2c Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 15 Aug 2024 18:18:04 +0200 Subject: [PATCH] increase batch size --- app/cron_options_bubble.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/cron_options_bubble.py b/app/cron_options_bubble.py index 681df8b..c10a7b2 100755 --- a/app/cron_options_bubble.py +++ b/app/cron_options_bubble.py @@ -113,12 +113,12 @@ async def main(): try: stock_con = sqlite3.connect('stocks.db') stock_cursor = stock_con.cursor() - stock_cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE marketCap >= 500E6 AND symbol NOT LIKE '%.%'") + stock_cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE symbol NOT LIKE '%.%'") stock_symbols = [row[0] for row in stock_cursor.fetchall()] etf_con = sqlite3.connect('etf.db') etf_cursor = etf_con.cursor() - etf_cursor.execute("SELECT DISTINCT symbol FROM etfs WHERE totalAssets >= 10E9") + etf_cursor.execute("SELECT DISTINCT symbol FROM etfs") etf_symbols = [row[0] for row in etf_cursor.fetchall()] stock_con.close() @@ -129,7 +129,7 @@ async def main(): print(len(total_symbols)) - chunk_size = len(total_symbols) // 100 # Divide the list into N chunks + chunk_size = len(total_symbols) // 1000 # Divide the list into N chunks chunks = [total_symbols[i:i + chunk_size] for i in range(0, len(total_symbols), chunk_size)] loop = asyncio.get_running_loop()