about summary refs log tree commit homepage
path: root/examples/rails_app-2.3.4/app
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-12 18:43:51 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-12 18:43:51 -0800
commita00f6fdb9b78a295307bada20f1e0dcaae59ac6d (patch)
treeb4974ce2f075f4bcd6a12ab8db6c5ca0e356f2e3 /examples/rails_app-2.3.4/app
parent20c4841a76a6a01dd7f0ed761945cdc8e07785d0 (diff)
downloadupr-a00f6fdb9b78a295307bada20f1e0dcaae59ac6d.tar.gz
examples/rails: UprStatus reuses expiry in Upr::Monitor
Thou Shalt Not Repeat Thyself.
Thou Shalt Not Repeat Thyself.
Thou Shalt Not Repeat Thyself.
Thou Shalt Not Repeat Thyself.
Thou Shalt Not Repeat Thyself.
Thou Shalt Not Repeat Thyself.

wait...
Diffstat (limited to 'examples/rails_app-2.3.4/app')
-rw-r--r--examples/rails_app-2.3.4/app/models/upr_status.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/rails_app-2.3.4/app/models/upr_status.rb b/examples/rails_app-2.3.4/app/models/upr_status.rb
index eeefd8b..a8afc30 100644
--- a/examples/rails_app-2.3.4/app/models/upr_status.rb
+++ b/examples/rails_app-2.3.4/app/models/upr_status.rb
@@ -1,6 +1,4 @@
 class UprStatus < ActiveRecord::Base
-  cattr_accessor :gc_cutoff
-  @@gc_cutoff = 10
 
   class << self
     def read(upid)
@@ -46,7 +44,7 @@ class UprStatus < ActiveRecord::Base
     end
 
     def gc
-      cutoff = Time.now.to_i - @@gc_cutoff
+      cutoff = Time.now.to_i - Upr::Monitor::OPT[:expires_in]
       delete_all "time < #{cutoff}"
     end
   end