-
Notifications
You must be signed in to change notification settings - Fork 30
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 SQLAlchemy error handling to tasks and the irc backend #272
Add SQLAlchemy error handling to tasks and the irc backend #272
Conversation
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
190f2f5
to
4e34c4a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #272 +/- ##
===========================================
- Coverage 56.78% 56.53% -0.26%
===========================================
Files 70 70
Lines 3862 3690 -172
Branches 528 474 -54
===========================================
- Hits 2193 2086 -107
+ Misses 1594 1536 -58
+ Partials 75 68 -7
Continue to review full report at Codecov.
|
Add SQLAlchemy error handling to the tasks. fixes fedora-infra#268 Signed-off-by: Jeremy Cline <jeremy@jcline.org>
4e34c4a
to
36663ba
Compare
fmn/delivery/backends/irc.py
Outdated
@@ -206,66 +216,71 @@ def subcmd_filters(self, nick, message): | |||
log.info("CMD list filters: %r sent us %r" % (nick, message)) | |||
|
|||
valid_paths = fmn.lib.load_rules(root="fmn.rules") | |||
sess = fmn.lib.models.init(self.config.get('fmn.sqlalchemy.uri')) | |||
pref = self.get_preference(sess, nick) | |||
sess = fmn.lib.models.Session.remove() |
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.
Shouldn't this be .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.
No, fmn.lib.models.Session
is a scoped 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.
Sure. But at this moment you are trying to get a new session, correct? Not closing this one, right at the start of the call?
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.
Specifically: you're assigned the result to the Session.remove()
call to something, but that function doesn't even return anything? https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/scoping.py#L76
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.
Please fix sess = ..Session.remove()
.
Otherwise looks fine.
36663ba
to
4795948
Compare
fixes fedora-infra#271 Signed-off-by: Jeremy Cline <jeremy@jcline.org>
4795948
to
5213eb1
Compare
No description provided.