This commit is contained in:
LeoR156
2026-07-10 09:49:55 +05:00
committed by GitHub
parent d97b55a453
commit d115691be0
+2 -1
View File
@@ -15,7 +15,7 @@ data_folder = root / "data"
db_path = data_folder / "db.sqlite" db_path = data_folder / "db.sqlite"
engine = create_engine(f'sqlite:///{db_path}') engine = create_engine(f'sqlite:///{db_path}')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine) Session = sessionmaker(bind=engine)
session = Session() session = Session()
@@ -141,6 +141,7 @@ def _reload_chat(chat_id: int):
chat = session.query(Chat).filter(Chat.chat_id == chat_id).first() chat = session.query(Chat).filter(Chat.chat_id == chat_id).first()
CACHE[chat_id] = chat CACHE[chat_id] = chat
Base.metadata.create_all(engine)
_fill_cache() _fill_cache()
logging.warning("[START] Load data from db to cache") logging.warning("[START] Load data from db to cache")