* VRFS-2520 - recordings can be cleaned up now

This commit is contained in:
Seth Call 2014-12-02 17:13:34 -06:00
parent 0601e85e9d
commit 589a2f6cc6
2 changed files with 10 additions and 0 deletions

View File

@ -587,6 +587,7 @@ module JamRuby
.having('COUNT(recorded_tracks.id) = COUNT(discard_info.id)')
.where("NOW() - recordings.updated_at > '#{APP_CONFIG.recordings_stale_time} day'::INTERVAL")
.limit(1000)
.readonly(false)
end
def mark_delete

View File

@ -696,6 +696,15 @@ describe Recording do
stale = Recording.discarded_and_stale
stale.first.should eq(recording1)
end
"is not readonly" do
# now age the recording
Recording.where(:id => recording1.id).update_all(:updated_at => (APP_CONFIG.recordings_stale_time + 1).days.ago)
# and we should find it now...
stale = Recording.discarded_and_stale
stale.first.readonly?.should be_false
end
end
describe "that has discard vote" do