lib/rocket_job/plugins/job/worker.rb in rocketjob-5.4.1 vs lib/rocket_job/plugins/job/worker.rb in rocketjob-6.0.0.rc1

- old
+ new

@@ -46,15 +46,15 @@ # # Exceptions are _not_ suppressed and should be handled by the caller. def perform_now raise(::Mongoid::Errors::Validations, self) unless valid? - worker = RocketJob::Worker.new(inline: true) + worker = RocketJob::Worker.new start if may_start? # Re-Raise exceptions rocket_job_work(worker, true) if running? - result + @rocket_job_output end def perform(*) raise NotImplementedError end @@ -102,14 +102,9 @@ # Allows @rocket_job_output to be modified by after/around callbacks run_callbacks(:perform) do # Allow callbacks to fail, complete or abort the job @rocket_job_output = perform if running? end - end - - if collect_output? - # Result must be a Hash, if not put it in a Hash - self.result = @rocket_job_output.is_a?(Hash) ? @rocket_job_output : {"result" => @rocket_job_output} end if new_record? || destroyed? complete if may_complete? else