New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/7a50e8eba2eebcea1e8a26e8afab989353d6feb2 commit 7a50e8eba2eebcea1e8a26e8afab989353d6feb2 Author: Gregg Tanzillo <gtanzill> AuthorDate: Tue Sep 10 09:28:14 2019 -0400 Commit: Gregg Tanzillo <gtanzill> CommitDate: Tue Sep 10 09:28:14 2019 -0400 Merge pull request #19264 from d-m-u/schedule_compliance_purge_or_whatever Schedule compliance purging (cherry picked from commit 87935ce0e85cad7dd6f9554136fdc5f69f200d12) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1767808 app/models/compliance.rb | 1 + app/models/compliance/purging.rb | 24 + app/models/miq_schedule_worker/jobs.rb | 4 + app/models/miq_schedule_worker/runner.rb | 5 + config/settings.yml | 5 + spec/models/compliance/purging_spec.rb | 54 + 6 files changed, 93 insertions(+) https://github.com/ManageIQ/manageiq/commit/737ae1f8f8bf5ab301e5c6f394a0876a03c83ed1 commit 737ae1f8f8bf5ab301e5c6f394a0876a03c83ed1 Author: Gregg Tanzillo <gtanzill> AuthorDate: Tue Sep 24 14:21:27 2019 -0400 Commit: Gregg Tanzillo <gtanzill> CommitDate: Tue Sep 24 14:21:27 2019 -0400 Merge pull request #19326 from agrare/fix_compliance_purge_timer_exception Fix an exception calling compliance_purge_timer (cherry picked from commit 14e2cf0fe1c87001ab3210cb501481357741a7fb) https://bugzilla.redhat.com/show_bug.cgi?id=1767808 app/models/miq_schedule_worker/runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I created 40e3 Compliances using the rails console (I did set the timestamp to current time). I changed the compliance_purge_interval to one 1.minutes (not sure this was necessary). Then I advanced the time by six months to the future (with crhonyd disabled). The created Compliance objects disappeared quite instantly and I see this in evm.log: workManager::EventCatcher::Runner#start_event_monitor) EMS [env-rhv43-mgr.cfme2.lab.eng.rdu2.redhat.com] as [admin@internal] Started Event Monitor Thread [----] I, [2020-06-11T00:01:40.438265 #13115:2b1f616945b4] INFO -- : MIQ(Compliance.purge_in_batches) Purging 10000 Compliances. [----] I, [2020-06-11T00:01:41.107928 #13115:2b1f616945b4] INFO -- : MIQ(Compliance.purge_in_batches) Purging 10000 Compliances. [----] I, [2020-06-11T00:01:41.710322 #13115:2b1f616945b4] INFO -- : MIQ(Compliance.purge_by_date) Purging Compliances older than [2019-12-11 13:07:00 UTC]...Complete - Deleted 40000 records