Module: Amigo::SemaphoreBackoffJob

Defined in:
lib/amigo/semaphore_backoff_job.rb

Defined Under Namespace

Modules: InstanceMethods, PrependedMethods

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.enabledObject

Return true if backoff checks are enabled.



66
67
68
# File 'lib/amigo/semaphore_backoff_job.rb', line 66

def enabled
  @enabled
end

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/amigo/semaphore_backoff_job.rb', line 68

def enabled?
  return @enabled
end

.included(cls) ⇒ Object



53
54
55
56
# File 'lib/amigo/semaphore_backoff_job.rb', line 53

def self.included(cls)
  cls.include InstanceMethods
  cls.prepend PrependedMethods
end

.resetObject

Reset class state. Mostly used just for testing.



60
61
62
63
# File 'lib/amigo/semaphore_backoff_job.rb', line 60

def reset
  is_testing = defined?(::Sidekiq::Testing) && ::Sidekiq::Testing.enabled?
  @enabled = !is_testing
end