The logic for my code is: look for a Lead with a specific email; if none exists, create a Lead with that email address.
The problem is that this code is running pretty frequently for the same email address: every 10 seconds. It seems that it takes Salesforce longer to create the Lead and update its servers because I'm seeing doubles of the Lead. Subsequent requests correctly find that a Lead with that email address already exists.
I'm wondering how long I should wait for the creation (or update or delete) process to finish, and whether there's another REST API endpoint other than the one for FIND that takes this issue into consideration.