mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2025-12-15 16:10:39 +03:00
add style check by ruff (#34)
* reformat settings * add init tests for timed lru cache * add check style by ruff
This commit is contained in:
@@ -44,9 +44,9 @@ class Database:
|
||||
session: Session = self._sync_session_factory()
|
||||
try:
|
||||
return session
|
||||
except Exception as err:
|
||||
except Exception:
|
||||
session.rollback()
|
||||
raise err
|
||||
raise
|
||||
finally:
|
||||
session.commit()
|
||||
session.close()
|
||||
@@ -71,9 +71,9 @@ class Database:
|
||||
async with self._async_session_factory() as session, session.begin():
|
||||
try:
|
||||
yield session
|
||||
except Exception as error:
|
||||
except Exception:
|
||||
await session.rollback()
|
||||
raise error
|
||||
raise
|
||||
|
||||
async def create_database(self) -> None:
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""initial commit
|
||||
|
||||
Revision ID: eb78565abec7
|
||||
Revises:
|
||||
Revises:
|
||||
Create Date: 2023-10-05 18:28:30.915361
|
||||
|
||||
"""
|
||||
|
||||
@@ -30,7 +30,7 @@ def upgrade() -> None:
|
||||
models = results.scalars().all()
|
||||
|
||||
if models:
|
||||
return None
|
||||
return
|
||||
models = []
|
||||
for model in ChatGptModelsEnum.values():
|
||||
priority = 0 if model != "gpt-3.5-turbo-stream-FreeGpt" else 1
|
||||
|
||||
Reference in New Issue
Block a user