Class: Fluent::Plugin::TailInput::TimerTrigger

Inherits:
Coolio::TimerWatcher
  • Object
show all
Defined in:
lib/fluent/plugin/in_tail.rb

Instance Method Summary collapse

Constructor Details

#initialize(interval, log, &callback) ⇒ TimerTrigger

Returns a new instance of TimerTrigger.



776
777
778
779
780
# File 'lib/fluent/plugin/in_tail.rb', line 776

def initialize(interval, log, &callback)
  @log = log
  @callback = callback
  super(interval, true)
end

Instance Method Details

#on_timerObject



782
783
784
785
786
787
# File 'lib/fluent/plugin/in_tail.rb', line 782

def on_timer
  @callback.call
rescue => e
  @log.error e.to_s
  @log.error_backtrace
end