-
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
refactor: remove non necessary SQL queries #227
base: unavailable-resources-management
Are you sure you want to change the base?
refactor: remove non necessary SQL queries #227
Conversation
3c86983
to
e435b71
Compare
7062507
to
2fd106a
Compare
e435b71
to
3dd3d65
Compare
2fd106a
to
9e0f626
Compare
3dd3d65
to
9067981
Compare
ffb3af2
to
bfb7640
Compare
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.
Nice cleanup, always feels good to remove some DB queries <3
🚢
"""Notify udata of the result of a parsing""" | ||
# Get the check again to get its updated data |
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.
Did the data get updated in the meantime? Is that why it was re-querying the data?
I struggle to see how the data could be meaningfully changed in this time period, which I assume is very short, unless this code is long-running?
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.
I remember stumbling on a Sentry error case where the check seems that it was updated in the meantime, so I added this comment a month ago, but I asked myself the exact same question, I couldn't see why the check should have been changed within the period.
In this PR, each Check.update()
execution now also return the updated check record and replace the object, so we now should be 100% sure the object is updated before it is passed to notify_udata
in the finally
clause.
Will be tested on dev and demo.
96495df
to
f9fb82a
Compare
df50c84
to
5a914c6
Compare
Needs to be merged after #163.
This is a refactoring PR to remove many non necessaries SQL queries, using the existing data in the code instead of re-querying it.