Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JosephBrianChambers/7b7e0cef58ee2abdf87d to your computer and use it in GitHub Desktop.
Save JosephBrianChambers/7b7e0cef58ee2abdf87d to your computer and use it in GitHub Desktop.
Queue TopicUpdate AccountMeta sync
# 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