-
Notifications
You must be signed in to change notification settings - Fork 18
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
Log payloads that are skipped becuse no jobs were run #42
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module Cangaroo | ||
class PerformJobs | ||
include Cangaroo::Log | ||
include Interactor | ||
|
||
def call | ||
|
@@ -15,7 +16,20 @@ def data | |
end | ||
|
||
def enqueue_jobs(type, payload) | ||
initialize_jobs(type, payload).select(&:perform?).each(&:enqueue) | ||
initialize_jobs(type, payload).each do |job| | ||
if job.perform? | ||
# TODO log simplified info about payload info is being queued | ||
job.enqueue | ||
else | ||
# TODO persist translation for audit trail? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Annotation keywords like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iloveitaly Can you explain how do you plan to use translation on the logging class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is referring to the If the job is not queued it won't be saved to the translation log. However, I think it would be helpful to have a record of the translation even if the payload is not pushed to a job There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iloveitaly can you also remove the |
||
|
||
log.info 'skipping job for payload', | ||
skipped_job: job.class.to_s, | ||
payload: payload, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align the parameters of a method call if they span more than one line. |
||
payload_type: type, | ||
payload_state: job.payload_state | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iloveitaly What's that 😸 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops! Forgot to remove this. This relies on the https://github.com/nebulab/cangaroo/pull/19/files#diff-45c84b17b9d53ae7c13d03d296304e38R27 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iloveitaly can you please remove it, we'll add it in the future. |
||
end | ||
end | ||
end | ||
|
||
def initialize_jobs(type, payload) | ||
|
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.
Annotation keywords like
TODO
should be all upper case, followed by a colon, and a space, then a note describing the problem.