Hi, I’m sending a massive number(over 100k) of custom properties through a for loop and python sdk, but this took too much time and got ConnectionResetError(104, 'Connection reset by peer'). I know this is due to some protection from the server, but I don’t know in what condition will trigger this error. So I’m wondering the best practice if I have a lot of data to send.
Here’s what I have tried:
- sent the data with an array like this, but got a 500 internal server error:
{'token': 'mykey',
'properties': [{'$email': 'e1', 'mylabel': 0.0014},
{'$email': 'e2', 'mylabel': 0.0002}]}
- iterated all my data, but somehow got ConnectionResetError:
from klaviyo_sdk import Client
client = Client(private_key, max_delay=5, max_retries=2)
succeed_emails = []
failed_emails = []
for email, label in zip(emails, labels):
data = {
"token": private_key,
"properties": {
"$email": email,
"mylabel": label
}
}
res = client.TrackIdentify.identify_post(data=data)
if res == "0":
failed_emails.append(email)
else:
succeed_emails.append(email)
By the way, this is probably related to this topic.
Thank you!