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