3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/eye/process/watchers.rb', line 3
def add_watchers(force = false)
return unless self.up?
remove_watchers if force
if @watchers.blank?
add_watcher(:check_alive, self[:check_alive_period]) do
check_alive
end
if self[:check_identity]
add_watcher(:check_identity, self[:check_identity_period]) do
check_identity
end
end
if self[:monitor_children]
add_watcher(:check_children, self[:children_update_period]) do
add_or_update_children
end
end
start_checkers
else
warn 'add_watchers failed, watchers are already present'
end
end
|