mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Log deleted contacts to file, don't send poll message on initial cycle
This commit is contained in:
parent
ab1fa9064e
commit
7e9a3250bd
3 changed files with 17 additions and 4 deletions
|
@ -1,9 +1,9 @@
|
|||
namespace :contacts do
|
||||
desc 'Archives inactive contacts'
|
||||
|
||||
task :archive, [:track_id] => [:environment] do |_t, args|
|
||||
task :archive, %i[track_id initial_run] => [:environment] do |_t, args|
|
||||
unlinked_contacts = contacts_start_point(args[:track_id])
|
||||
|
||||
initial_run = args[:initial_run] == true || args[:initial_run] == 'true'
|
||||
counter = 0
|
||||
log("Found #{unlinked_contacts.count} unlinked contacts. Starting to archive.")
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace :contacts do
|
|||
next unless contact.archivable?
|
||||
|
||||
log("Archiving contact: id(#{contact.id}), code(#{contact.code})")
|
||||
contact.archive(verified: true)
|
||||
contact.archive(verified: true, notify: !initial_run, extra_log: initial_run)
|
||||
counter += 1
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue