Skip to content

Commit

Permalink
add API request log
Browse files Browse the repository at this point in the history
  • Loading branch information
takkanm committed Dec 16, 2015
1 parent df2a11d commit ef94339
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit ef94339

Please sign in to comment.