app/models/good_job/execution.rb in good_job-3.7.1 vs app/models/good_job/execution.rb in good_job-3.7.2

- old
+ new

@@ -314,12 +314,19 @@ # @return [Boolean] def executable? self.class.unscoped.unfinished.owns_advisory_locked.exists?(id: id) end - def active_job + # Build an ActiveJob instance and deserialize the arguments, using `#active_job_data`. + # + # @param ignore_deserialization_errors [Boolean] + # Whether to ignore ActiveJob::DeserializationError when deserializing the arguments. + # This is most useful if you aren't planning to use the arguments directly. + def active_job(ignore_deserialization_errors: false) ActiveJob::Base.deserialize(active_job_data).tap do |aj| aj.send(:deserialize_arguments_if_needed) + rescue ActiveJob::DeserializationError + raise unless ignore_deserialization_errors end end # Return formatted serialized_params for display in the dashboard # @return [Hash]