diff --git a/app/interactors/cangaroo/perform_jobs.rb b/app/interactors/cangaroo/perform_jobs.rb index 972db2f..34b24b0 100644 --- a/app/interactors/cangaroo/perform_jobs.rb +++ b/app/interactors/cangaroo/perform_jobs.rb @@ -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? + + log.info 'skipping job for payload', + skipped_job: job.class.to_s, + payload: payload, + payload_type: type, + payload_state: job.payload_state + end + end end def initialize_jobs(type, payload)