feat: add language detection task

This commit is contained in:
Felix Spöttel
2023-06-29 09:13:11 +02:00
parent d2223206be
commit 908bd48170
15 changed files with 267 additions and 191 deletions

View File

@@ -19,11 +19,8 @@ SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
def get_session() -> Generator[Session, None, None]:
db: Session = SessionLocal()
session: Session = SessionLocal()
try:
yield db
db.commit()
except Exception:
db.rollback()
yield session
finally:
db.close()
session.close()