Skip to content

Commit

Permalink
Merge pull request #5 from treasure-data/add_request_log
Browse files Browse the repository at this point in the history
add API request log
  • Loading branch information
uu59 committed Jan 6, 2016
2 parents 483daee + ef94339 commit 9987d7c
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 9987d7c

Please sign in to comment.