houdini/lib/tasks/full_contact.rake

20 lines
569 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2020-06-12 20:03:43 +00:00
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
desc 'For generating Full Contact data'
# Clear old activerecord sessions tables daily
task work_full_contact_queue: :environment do
loop do
sleep(10) until Qx.select('COUNT(*)').from('full_contact_jobs').execute.first['count'] > 0
puts 'working...'
begin
InsertFullContactInfos.work_queue
rescue Exception => e
puts "Exception thrown: #{e}"
end
end
end