Sha256: 2318a64cf0a7cd4fb78c8fd858b05c319f07472198c6b80a7b428ee6071ab355

Contents?: true

Size: 653 Bytes

Versions: 47

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  ###
  # Calls the #set_default_thumbnail method
  # on the object passed in and calls save
  ###
  class UpdateJobTrackersJob < Spotlight::ApplicationJob
    def perform(job_tracker)
      reports_on = job_tracker.on

      return unless reports_on.is_a? Spotlight::JobTracker

      reports_on.update(status: 'completed') if reports_on.job_trackers.all?(&:completed?)
      reports_on.update(status: 'failed') if reports_on.job_trackers.any?(&:failed?)

      reports_on.update(data: { progress: reports_on.job_trackers.sum(&:progress), total: reports_on.job_trackers.sum(&:total) })
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.3.5 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.3.4 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.3.3 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.3.2 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.3.1 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.3.0 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.2.0 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.1.2 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.1.1 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.1.0 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.0.3 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.0.2 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.0.1 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-4.0.0 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-3.6.0.beta10 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-3.6.0.beta9 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-3.6.0.beta8 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-3.5.0.4 app/jobs/spotlight/update_job_trackers_job.rb
blacklight-spotlight-3.6.0.beta7 app/jobs/spotlight/update_job_trackers_job.rb