Skip to content

Commit

Permalink
Merge pull request #36 from bakins/add_service_watchers
Browse files Browse the repository at this point in the history
Load a service check module if added to the config.
  • Loading branch information
igor47 committed Jan 14, 2015
2 parents 7e73de7 + bd6198f commit 2a9ddcb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nerve/service_watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def initialize(service={})
service['checks'].each do |check|
check['type'] ||= "undefined"
begin
unless ServiceCheck::CHECKS[check['type']]
m = check['module'] ? check['module'] : "nerve-watcher-#{check['type']}"
require m
end
service_check_class = ServiceCheck::CHECKS[check['type']]
rescue
raise ArgumentError,
Expand Down

0 comments on commit 2a9ddcb

Please sign in to comment.