diff --git a/app/models/policy_event/purging.rb b/app/models/policy_event/purging.rb index f0f0303a053..b0036d3a83c 100644 --- a/app/models/policy_event/purging.rb +++ b/app/models/policy_event/purging.rb @@ -12,16 +12,6 @@ def purge_window_size ::Settings.policy_events.history.purge_window_size end - def purge_queue - MiqQueue.put_unless_exists( - :class_name => name, - :method_name => "purge", - :role => "event", - :queue_name => "ems" - ) - end - alias_method :purge_timer, :purge_queue - def purge_scope(older_than) where(arel_table[:timestamp].lt(older_than)) end diff --git a/spec/models/policy_event/purging_spec.rb b/spec/models/policy_event/purging_spec.rb index f4e4356166c..3c1b5f10bfc 100644 --- a/spec/models/policy_event/purging_spec.rb +++ b/spec/models/policy_event/purging_spec.rb @@ -1,30 +1,18 @@ describe PolicyEvent do context "::Purging" do - context ".purge_queue" do + context ".purge_timer" do before do EvmSpecHelper.create_guid_miq_server_zone end it "with nothing in the queue" do - described_class.purge_queue + described_class.purge_timer q = MiqQueue.all expect(q.length).to eq(1) expect(q.first).to have_attributes( :class_name => described_class.name, - :method_name => "purge" - ) - end - - it "with item already in the queue" do - described_class.purge_queue - described_class.purge_queue - - q = MiqQueue.all - expect(q.length).to eq(1) - expect(q.first).to have_attributes( - :class_name => described_class.name, - :method_name => "purge" + :method_name => "purge_by_date" ) end end