Class: SourceMonitor::Health::SourceHealthReset

Inherits:
Object
  • Object
show all
Defined in:
lib/source_monitor/health/source_health_reset.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, now: Time.current) ⇒ SourceHealthReset

Returns a new instance of SourceHealthReset.



10
11
12
13
# File 'lib/source_monitor/health/source_health_reset.rb', line 10

def initialize(source:, now: Time.current)
  @source = source
  @now = now
end

Class Method Details

.call(source:, now: Time.current) ⇒ Object



6
7
8
# File 'lib/source_monitor/health/source_health_reset.rb', line 6

def self.call(source:, now: Time.current)
  new(source:, now:).call
end

Instance Method Details

#callObject



15
16
17
18
19
20
21
# File 'lib/source_monitor/health/source_health_reset.rb', line 15

def call
  return unless source

  source.with_lock do
    source.update!(reset_attributes)
  end
end