bugfixing

This commit is contained in:
MuslemRahimi 2025-01-12 20:32:31 +01:00
parent 574c2b1413
commit b0e664940c
2 changed files with 2 additions and 9 deletions

View File

@ -93,7 +93,6 @@ async def get_todays_data(ticker):
async def run(): async def run():
con = sqlite3.connect('stocks.db') con = sqlite3.connect('stocks.db')
etf_con = sqlite3.connect('etf.db') etf_con = sqlite3.connect('etf.db')
crypto_con = sqlite3.connect('crypto.db')
cursor = con.cursor() cursor = con.cursor()
cursor.execute("PRAGMA journal_mode = wal") cursor.execute("PRAGMA journal_mode = wal")
@ -105,16 +104,10 @@ async def run():
etf_cursor.execute("SELECT DISTINCT symbol FROM etfs") etf_cursor.execute("SELECT DISTINCT symbol FROM etfs")
etf_symbols = [row[0] for row in etf_cursor.fetchall()] etf_symbols = [row[0] for row in etf_cursor.fetchall()]
crypto_cursor = crypto_con.cursor()
crypto_cursor.execute("PRAGMA journal_mode = wal")
crypto_cursor.execute("SELECT DISTINCT symbol FROM cryptos")
crypto_symbols = [row[0] for row in crypto_cursor.fetchall()]
con.close() con.close()
etf_con.close() etf_con.close()
crypto_con.close()
total_symbols = stocks_symbols + etf_symbols + crypto_symbols total_symbols = stocks_symbols + etf_symbols
total_symbols = sorted(total_symbols, key=lambda x: '.' in x) total_symbols = sorted(total_symbols, key=lambda x: '.' in x)

View File

@ -23,7 +23,7 @@ def check_market_hours():
# Determine the market status # Determine the market status
if is_weekend or is_holiday: if is_weekend or is_holiday:
return False #"Market is closed." return False #"Market is closed."
elif 9 <= current_hour < 16 or (current_hour == 17 and current_minute == 0): elif 9 <= current_hour < 17 or (current_hour == 17 and current_minute == 0):
return True #"Market hours." return True #"Market hours."
else: else:
return False #"Market is closed." return False #"Market is closed."