bugfixing
This commit is contained in:
parent
574c2b1413
commit
b0e664940c
@ -93,7 +93,6 @@ async def get_todays_data(ticker):
|
||||
async def run():
|
||||
con = sqlite3.connect('stocks.db')
|
||||
etf_con = sqlite3.connect('etf.db')
|
||||
crypto_con = sqlite3.connect('crypto.db')
|
||||
|
||||
cursor = con.cursor()
|
||||
cursor.execute("PRAGMA journal_mode = wal")
|
||||
@ -105,16 +104,10 @@ async def run():
|
||||
etf_cursor.execute("SELECT DISTINCT symbol FROM etfs")
|
||||
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()
|
||||
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)
|
||||
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ def check_market_hours():
|
||||
# Determine the market status
|
||||
if is_weekend or is_holiday:
|
||||
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."
|
||||
else:
|
||||
return False #"Market is closed."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user