Skip to content

Commit

Permalink
Use new purge_by_orphaned method for binary_blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Jan 18, 2018
1 parent 897076a commit 0855779
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/models/binary_blob/purging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ module Purging

module ClassMethods
def purge_timer
purge_queue(:scope)
purge_queue(:orphaned, 'resource')
end

def purge_window_size
::Settings.binary_blob.purge_window_size
end

def purge_scope(_older_than = nil)
where(:resource_type => 'MiqQueue').where.not('resource_id in (select id from miq_queue)')
end

def purge_associated_records(ids)
BinaryBlobPart.where(:binary_blob_id => ids).delete_all
end
Expand Down

0 comments on commit 0855779

Please sign in to comment.