lib/good_job/job.rb in good_job-2.0.4 vs lib/good_job/job.rb in good_job-2.0.5

- old
+ new

@@ -16,12 +16,10 @@ DEFAULT_PRIORITY = 0 self.table_name = 'good_jobs' self.advisory_lockable_column = 'active_job_id' - attr_readonly :serialized_params - # Parse a string representing a group of queues into a more readable data # structure. # @param string [String] Queue string # @return [Hash] # How to match a given queue. It can have the following keys and values: @@ -275,17 +273,17 @@ private # @return [ExecutionResult] def execute - params = serialized_params.merge( - "provider_job_id" => id - ) - GoodJob::CurrentExecution.reset GoodJob::CurrentExecution.good_job = self + + job_data = serialized_params.deep_dup + job_data["provider_job_id"] = id + ActiveSupport::Notifications.instrument("perform_job.good_job", { good_job: self, process_id: GoodJob::CurrentExecution.process_id, thread_name: GoodJob::CurrentExecution.thread_name }) do - value = ActiveJob::Base.execute(params) + value = ActiveJob::Base.execute(job_data) if value.is_a?(Exception) handled_error = value value = nil end