1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
From: Dmitry Borodaenko <angdraug@debian.org>
Date: Thu, 15 Mar 2012 21:40:35 +0300
Subject: Invoke unix_listener_stats conditionally
unix_listener_stats reads /proc/net/unix on every invokation, that is
not only expensive, but also breaks the test suite when build process
isn't allowed to access /proc.
---
lib/raindrops/watcher.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/raindrops/watcher.rb b/lib/raindrops/watcher.rb
index ac5b895..a24ea69 100644
--- a/lib/raindrops/watcher.rb
+++ b/lib/raindrops/watcher.rb
@@ -171,7 +171,7 @@ def aggregator_thread(logger) # :nodoc:
thr = Thread.new do
begin
combined = tcp_listener_stats(@tcp_listeners, sock)
- combined.merge!(unix_listener_stats(@unix_listeners))
+ combined.merge!(unix_listener_stats(@unix_listeners)) if @unix_listeners
@lock.synchronize do
now = Time.now.utc
combined.each do |addr,stats|
|