We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77c47e3 commit 0097ea1Copy full SHA for 0097ea1
janrain_datalib/schemarecords.py
@@ -71,8 +71,11 @@ def create_batch(batch):
71
if not batch_size:
72
# find reasonable batch size based on size of first record
73
record_len = len(json.dumps(record))
74
- # batches will be approx 1MB
+ # limit batches to approx 1MB
75
batch_size = 1 + int(1000000 / record_len)
76
+ if batch_size > 2000:
77
+ # or 2000 records, whichever is less
78
+ batch_size = 2000
79
if len(batch) >= batch_size:
80
for item in create_batch(batch):
81
yield item
0 commit comments