From a00f6fdb9b78a295307bada20f1e0dcaae59ac6d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 12 Nov 2009 18:43:51 -0800 Subject: 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... --- examples/rails_app-2.3.4/app/models/upr_status.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'examples/rails_app-2.3.4/app') 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 -- cgit v1.2.3-24-ge0c7