waynerobinson/xeroizer — pull request #79 by fimmtiu (2013-04-24 22:41:16+00:00)
Title: Chunk large batch saves to prevent timeout errors

Turns out that, while batch saves are great at reducing the number of API calls you make, Xero's not so great at handling them once you get into "several thousand records per update" territory. We're getting lots of timeout errors syncing a >10,000-contact data set, and this seems to relieve them.

Basically, we just break a batch_save into N chunks of 2,000 records and make N requests.