Add MailchimpSupporterSyncJob

This commit is contained in:
Eric Schultz 2019-11-07 15:51:24 -06:00
parent 626e01b035
commit 84b1960a9d
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
class MailchimpSupporterSyncJob < ApplicationJob
queue_as :default
def perform(np_id, supporter_ids, tag_data)
Mailchimp.sync_supporters_to_list_from_tag_joins(np_id, supporter_ids, tag_data)
end
end

View file

@ -81,7 +81,7 @@ module InsertTagJoins
# activities = Psql.execute( Qexpr.new.insert(:activities, activity_data) )
# Sync mailchimp lists, if present
Mailchimp.delay.sync_supporters_to_list_from_tag_joins(np_id, supporter_ids, tag_data)
MailchimpSupporterSyncJob.perform_later(np_id, supporter_ids, tag_data)
{ json: { inserted_count: tags.count, removed_count: deleted.count }, status: :ok }
end