Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pratham-darooka committed Jul 12, 2024
1 parent e1a062f commit eae708a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jobs/update_stocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main(all_stocks_list=None, fno_stocks_list=None):
if fno_stocks_list is None:
await update_all_stocks_concurrently([stock['id'] for stock in all_stocks_list])
elif all_stocks_list is None:
await update_all_stocks_concurrently([stock['id'] for stock in fno_stocks_list])
await update_all_stocks_concurrently([stock['stock_id'] for stock in fno_stocks_list])
else:
logger.error("No stocks input")

Expand All @@ -78,10 +78,10 @@ async def main(all_stocks_list=None, fno_stocks_list=None):
# break

if not is_market_open():
asyncio.run(main(fno_stocks_list=fno_stocks))
asyncio.run(main(all_stocks_list=all_stocks))
logger.info("No need to run further updates, market closed!")
break
else:
asyncio.run(main(fno_stocks_list=all_stocks))
asyncio.run(main(fno_stocks_list=fno_stocks))

time.sleep(1)

0 comments on commit eae708a

Please sign in to comment.