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
Convert C2M to worker Queue #1062
Conversation
baf9b83
to
4b5c471
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.
looks good to me. just one copy pasta comment!
app/jobs/catalog_to_moab_job.rb
Outdated
raise ArgumentError, 'CompleteMoab param required' unless job.arguments.first.is_a?(CompleteMoab) | ||
end | ||
|
||
# @param [CompleteMoab] complete_moab object to checksum |
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.
assuming this is copy pasta
- Now uses factory that is fixture-aware. - Use single `AuditResults` instance double for all cases. - Stop intercepting `UnrelatedModel.new(...)` and just set the double object directly into the subject where needed. Then set expecations on the model's getter (instead of on the double independently). - More better `before` blocks
@@ -56,8 +53,6 @@ class CompleteMoab < ApplicationRecord | |||
' AND (last_checksum_validation + (fixity_ttl * INTERVAL \'1 SECOND\')) < CURRENT_TIMESTAMP'\ | |||
' OR last_checksum_validation IS NULL' | |||
) | |||
# possibly counter-intuitive: the .order sorts so that null values come first (because IS NOT NULL evaluates | |||
# to 0 for nulls, which sorts before 1 for non-nulls, which are then sorted by last_checksum_validation) |
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.
small nitpick (leftovers from the prior PR that got rid of sort order on the scope): it'd be nice to move these comments to the class methods that are now provided as ordering wrappers.
merged, happy to do my nitpick as a follow-on if others find it agreeable. |
Note: we already abandoned order when we moved order from scopes to class methods. The service classes still called the scopes and not the class methods, so no ordering was happening.
That's more obvious now, since moving to a queue means asynchronicity inherently. Order enqueued does not guarantee order of completion. Also presumably parallelization provides better enough performance and reliability that we aren't worried about some objects never making it through.
Massive cleanup to twisty code. No entanglement of class methods and instance methods. A factory for fixtures!
Follow on work would include:
cleanup README, maybe wiki