bugfixing

This commit is contained in:
MuslemRahimi 2025-01-15 16:47:24 +01:00
parent 2c6e38137c
commit d3d2429a74
2 changed files with 23 additions and 19 deletions

View File

@ -50,6 +50,7 @@ async def process_category(cursor, category, condition, category_type='market-ca
res_list = []
for row in raw_data:
try:
symbol = row[0]
quote_data = await get_quote_data(symbol)
if quote_data:
@ -68,6 +69,8 @@ async def process_category(cursor, category, condition, category_type='market-ca
if item['marketCap'] > 0 and item['revenue'] > 0:
res_list.append(item)
except:
pass
# Sort by market cap and save
sorted_result = sorted(res_list, key=lambda x: x['marketCap'] if x['marketCap'] else 0, reverse=True)
@ -1176,6 +1179,7 @@ async def run():
#await asyncio.sleep(1) # Small delay between categories
# Process sector categories
for category, condition in sector_conditions.items():
await process_category(cursor, category, condition, 'sector')
#await asyncio.sleep(1) # Small delay between categories

View File

@ -376,7 +376,7 @@ schedule.every().day.at("09:30").do(run_threaded, run_profile).tag('profile_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_josb')
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')