diff --git a/app/models/contact.rb b/app/models/contact.rb index 7b83bec44..0035965b7 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -174,7 +174,9 @@ class Contact < ActiveRecord::Base end def destroy_orphans - find_orphans.destroy_all + STDOUT << "#{Time.now.utc} - Destroying orphaned contacts\n" + count = find_orphans.destroy_all.count + STDOUT << "#{Time.now.utc} - Successfully destroyed #{count} orphaned contacts\n" end end end diff --git a/config/schedule.rb b/config/schedule.rb index 9d9d442b0..df14d77c3 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -16,6 +16,6 @@ every 10.minutes do runner 'ZonefileSetting.generate_zonefiles' end -every 6.months, at: '1am' do +every 2.minutes do runner 'Contact.destroy_orphans' end