about summary refs log tree commit homepage
path: root/lib/yahns/fdmap.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-10-18 11:21:13 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-18 11:35:43 +0000
commitfe6358be43e54d91c2beb9b52ced0437ad45f913 (patch)
treeb5ab71ae89d1d7b60037bf43950f0910384d2517 /lib/yahns/fdmap.rb
parent94acc35b6bc42ca02033d111534b6f8135a724eb (diff)
downloadyahns-fe6358be43e54d91c2beb9b52ced0437ad45f913.tar.gz
This is rarely-called code, but we need to be sure we can expire
clients correctly when thresholds are reached.  We also correctly
handle negative values of the client_expire_threshold directive.
Diffstat (limited to 'lib/yahns/fdmap.rb')
-rw-r--r--lib/yahns/fdmap.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/yahns/fdmap.rb b/lib/yahns/fdmap.rb
index 0272421..1e1677a 100644
--- a/lib/yahns/fdmap.rb
+++ b/lib/yahns/fdmap.rb
@@ -12,8 +12,8 @@ class Yahns::Fdmap # :nodoc:
 
     if Float === client_expire_threshold
       client_expire_threshold *= Process.getrlimit(:NOFILE)[0]
-    elsif client_expire_treshhold < 0
-      client_expire_threshold = Process.getrlimit(:NOFILE)[0] -
+    elsif client_expire_threshold < 0
+      client_expire_threshold = Process.getrlimit(:NOFILE)[0] +
                                 client_expire_threshold
     end
     @client_expire_threshold = client_expire_threshold.to_i