* VRFS-2520 - recordings can be cleaned up now
This commit is contained in:
parent
0601e85e9d
commit
589a2f6cc6
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue