diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-11-12 18:43:51 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-11-12 18:43:51 -0800 |
commit | a00f6fdb9b78a295307bada20f1e0dcaae59ac6d (patch) | |
tree | b4974ce2f075f4bcd6a12ab8db6c5ca0e356f2e3 /examples | |
parent | 20c4841a76a6a01dd7f0ed761945cdc8e07785d0 (diff) | |
download | upr-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')
-rw-r--r-- | examples/rails_app-2.3.4/app/models/upr_status.rb | 4 |
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 |