-
Notifications
You must be signed in to change notification settings - Fork 210
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
Set asset size on job creation #5369
Conversation
I vaguely remember we once had something like this but removed the code again because it could lead to deadlocks between database transactions. I'll have a closer look at this tomorrow. |
The code path does an insert already, so a further update shouldn't hurt... |
Good, then this was probably a different place. |
Maybe? 8334b47 I don't really know anything about this deadlock bug and whether that's already addressed. |
My change was actually about
The loop your code is part of runs on the return value of
Not sure. But this is about ensuring assets have a size at all, right? I would say if |
Is that already handled in the download code or does that need to be added as well?
Yep, but FWICT this is only run once for all explicitly posted assets, so probably not worth the extra code. |
Good question. It doesn't look like it is handled by that code. The relevant file would be
Ok, although there's already a |
Looks like that needs the type which I'm not sure how to get at that point easily...
register would need a line to handle that like |
You would have to do another database query like this:
The only problem is that even
Right. |
Yeah... Fortunately this isn't that important for _URL assets as those can be downloaded from the job settings page directly, so something for a later PR?
|
Yes, we can save this for later as all of this is basically an optional improvement anyways. It would be good if your change would extend the tests, though. |
310d33d
to
fb6a34f
Compare
Well, without this PR it's currently not possible to download isos from o3.
Done. |
fb6a34f
to
9eab53e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5369 +/- ##
=======================================
Coverage 98.35% 98.36%
=======================================
Files 389 389
Lines 37432 37441 +9
=======================================
+ Hits 36818 36827 +9
Misses 614 614 ☔ View full report in Codecov by Sentry. |
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, I only have one small suggestion.
Assets without a size are treated like they don't exist. With POST isos, referenced assets don't directly get a size and are thus not shown as downloadable. Only the next limit_assets task run changes this by running refresh_assets. Improve this by setting the size for assets on job creation.
9eab53e
to
22f8b9b
Compare
Assets without a size are treated like they don't exist. With POST isos, referenced assets don't directly get a size and are thus not shown as downloadable. Only the next limit_assets task run changes this by running refresh_assets. Improve this by setting the size for assets on job creation.
ISO_1_URL
?refresh_size
here or should this end up asensure_size
instead?