-
Notifications
You must be signed in to change notification settings - Fork 999
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
[24.1] Fix named cursor is not valid anymore
#18825
[24.1] Fix named cursor is not valid anymore
#18825
Conversation
Fixes galaxyproject#18782 / https://sentry.galaxyproject.org/share/issue/dca23c8d10e743509648cf6092a1dc15/: ``` Message Error closing cursor Stack Trace Newest ProgrammingError: named cursor isn't valid anymore File "sqlalchemy/engine/cursor.py", line 1255, in fetchmany new = dbapi_cursor.fetchmany(size - lb) ProgrammingError: named cursor isn't valid anymore File "sqlalchemy/engine/base.py", line 2213, in _safe_close_cursor cursor.close() ```
8b6cc94
to
0344210
Compare
@@ -1119,7 +1119,7 @@ def get_jobs_to_check_at_startup(session: galaxy_scoped_session, track_jobs_in_d | |||
# Filter out the jobs of inactive users. | |||
stmt = stmt.outerjoin(User).filter(or_((Job.user_id == null()), (User.active == true()))) | |||
|
|||
return session.scalars(stmt) | |||
return session.scalars(stmt).all() |
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.
Maybe also add type annotation for the function return value?
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.
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.
It would help with code refactorings and when reviewing e.g. on GitHub, but it's fine if you prefer not to.
Fixes
#18782 / https://sentry.galaxyproject.org/share/issue/dca23c8d10e743509648cf6092a1dc15/:
(Please replace this header with a description of your pull request. Please include BOTH what you did and why you made the changes. The "why" may simply be citing a relevant Galaxy issue.)
(If fixing a bug, please add any relevant error or traceback)
(For UI components, it is recommended to include screenshots or screencasts)
How to test the changes?
(Select all options that apply)
License