Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add API request log #5

Merged
merged 1 commit into from
Jan 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/embulk/output/mailchimp.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'mailchimp'
require 'perfect_retry'

require 'securerandom'

module Embulk
module Output

Expand Down Expand Up @@ -153,13 +155,16 @@ def flush_subscribers!

def send_subscribers!
@retry_manager.with_retry do
@client.batch_subscribe_list(
request_id = SecureRandom.uuid
Embulk.logger.info "[#{request_id}] Request : #{@subscribers.size} items"
res = @client.batch_subscribe_list(
@list_id,
@subscribers,
@double_optin,
@update_existing,
@replace_interests
)
Embulk.logger.info "[#{request_id}] Result : #{res.to_s}"
end
end
end
Expand Down