Method: Tengine::Core::HeartbeatWatcher#initialize

Defined in:
lib/tengine/core/heartbeat_watcher.rb

#initialize(argv) ⇒ HeartbeatWatcher

Returns a new instance of HeartbeatWatcher.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/tengine/core/heartbeat_watcher.rb', line 21

def initialize argv
  @uuid = UUID.new.generate
  @config = Tengine::Core::Config::HeartbeatWatcher.parse argv
  @daemonize_options = {
    :app_name => 'tengine_heartbeat_watcher',
    :ARGV => [@config[:action]],
    :ontop => !@config[:process][:daemon],
    :multiple => true,
    :dir_mode => :normal,
    :dir => File.expand_path(@config[:process][:pid_dir]),
  }
  Tengine::Core::MethodTraceable.disabled = !@config[:verbose]
rescue Exception
  puts "[#{$!.class.name}] #{$!.message}\n  " << $!.backtrace.join("\n  ")
  raise
end