Sha256: 27f7137bbea3b019cd79f85125875929dc6a686105049434595c01d716202b92

Contents?: true

Size: 1.22 KB

Versions: 24

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module SidekiqUniqueJobs
  #
  # Class DeleteOrphans provides deletion of orphaned digests
  #
  # @note this is a much slower version of the lua script but does not crash redis
  #
  # @author Mikael Henriksson <mikael@zoolutions.se>
  #
  module Orphans
    #
    # Observes the Orphan::Manager and provides information about each execution
    #
    # @author Mikael Henriksson <mikael@zoolutions.se>
    #
    class Observer
      include SidekiqUniqueJobs::Logging

      #
      # Runs every time the {Manager} executes the TimerTask
      #   used for logging information about the reaping
      #
      # @param [Time] time the time of the execution
      # @param [Object] result the result of the execution
      # @param [Exception] ex any error raised from the TimerTask
      #
      # @return [<type>] <description>
      #
      def update(time, result, ex)
        if result
          log_info("(#{time}) Execution successfully returned #{result}")
        elsif ex.is_a?(Concurrent::TimeoutError)
          log_warn("(#{time}) Execution timed out")
        else
          log_info("(#{time}) Cleanup failed with error #{ex.message}")
          log_error(ex)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-7.0.0.beta25 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta24 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta23 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta22 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta21 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta20 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta19 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta18 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta17 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta16 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta15 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta14 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta13 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta12 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta11 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta10 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta9 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta8 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta7 lib/sidekiq_unique_jobs/orphans/observer.rb
sidekiq-unique-jobs-7.0.0.beta6 lib/sidekiq_unique_jobs/orphans/observer.rb