-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new models and fix sessions #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but couple things need to be fixed.
Also, run ruff check, there are some issues.
transcription = sum(transcription_list, AsrTranscription()) | ||
segments = sum(segments_list, AsrSegments()) | ||
transcription_info = sum(transcription_info_list, AsrTranscriptionInfo()) | ||
with get_session() as session: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't keep the session open for the long running tasks. It leads to too many connections to the database. In the long running tasks get session when you actually need to access database. You can combine multiple operations if they are executed in approximately the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Changes: