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

[WIP] each slice when over 300 leads on createupdate/delete #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

takuyan
Copy link
Contributor

@takuyan takuyan commented Mar 7, 2016

Fix for Over 300 leads

params[:asyncProcessing] = async_processing if async_processing
# see also: http://developers.marketo.com/documentation/rest/createupdate-leads/
# > You can update a maximum of 300 leads with a single API call.
leads.each_slice(MAX_LEADS_SIZE).map do |_leads|
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should flatten the output to not break the API with a new response type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the output to not break the API

Agree.
But when leads is over 300, we call multiple requests to marketo and receive multiple responses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But...I begin to thought that this method should be keep it simple.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point that's why I wrote that you should flatten the response, with #flat_map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants