1 class UprStatus < ActiveRecord::Base
2 cattr_accessor :gc_cutoff
7 if rv = find_by_upid(upid)
8 rv.time = Time.now.to_i
14 def start(upid, length)
15 # this must be a find_or_create_by since some users have twitchy
16 # fingers and hit the upload button prematurely
17 find_or_create_by_upid(upid) do |x|
19 x.time = Time.now.to_i
25 update_all("seen = seen + #{nr.to_i}, time = #{Time.now.to_i}",
30 cutoff = Time.now.to_i - @@gc_cutoff
31 delete_all "time < #{cutoff}"