mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 12:09:34 +02:00
Better loggin for orhpan delete method
This commit is contained in:
parent
8e70bcd6f4
commit
e664d46710
2 changed files with 4 additions and 2 deletions
|
@ -174,7 +174,9 @@ class Contact < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_orphans
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,6 +16,6 @@ every 10.minutes do
|
||||||
runner 'ZonefileSetting.generate_zonefiles'
|
runner 'ZonefileSetting.generate_zonefiles'
|
||||||
end
|
end
|
||||||
|
|
||||||
every 6.months, at: '1am' do
|
every 2.minutes do
|
||||||
runner 'Contact.destroy_orphans'
|
runner 'Contact.destroy_orphans'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue