Last active
August 29, 2015 14:22
-
-
Save JosephBrianChambers/7b7e0cef58ee2abdf87d to your computer and use it in GitHub Desktop.
Queue TopicUpdate AccountMeta sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Queue jobs to sync/save AccountMeta records via SocialGraphService for every TopicUpdate. | |
# This is to prevent high latency on SocialGraphService due to inline provider scraping(takes long time), during API requests | |
# Note: set SOCIAL_GRAPH_SERVICE_URL | |
# Note: set X-SSL-Auth | |
ElasticsearchTopicUpdate.migrate(nil) do |batch| | |
bulk_args = batch.map { |es_topic_updates| ['TopicUpdate', :sync_account_meta, [es_topic_updates.account_guid]] } | |
Sidekiq::Client.new(SIDEKIQ_TOPIC_REDIS).push_bulk('class' => MigrationWorker, 'args' => bulk_args) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment