From b0e664940c4ed6f915395d1bf7d421db84501db4 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 12 Jan 2025 20:32:31 +0100 Subject: [PATCH] bugfixing --- app/cron_one_day_price.py | 9 +-------- app/utils/helper.py | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/cron_one_day_price.py b/app/cron_one_day_price.py index f0c4188..a80d75c 100755 --- a/app/cron_one_day_price.py +++ b/app/cron_one_day_price.py @@ -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) diff --git a/app/utils/helper.py b/app/utils/helper.py index 7eeea15..f0d9f33 100644 --- a/app/utils/helper.py +++ b/app/utils/helper.py @@ -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."