0

I'm calling a parse cloud function from android. On the cloud code, I receive upto 4 requests and my data is getting corrupt because of this as I'm creating an object in each call to that function. I get a parse exception with error "SocketTimeoutException" only after the function has been executed 4 times on the cloud. Is there any way I can control the retry logic or the timeout duration for parse as I'd like to declare a failure only after 1st failure or increase the timeout duration.

Lavekush Agrawal
  • 6,040
  • 7
  • 52
  • 85
Tushar Nallan
  • 784
  • 6
  • 16
  • One solution to your problem would be implementing [idempotent](http://stackoverflow.com/questions/1077412/what-is-an-idempotent-operation) server side code. – JimmyB Aug 11 '15 at 12:28
  • @HannoBinder But I do want to add multiple items if there are multiple requests. Just that I want to avoid incorrect object creations – Tushar Nallan Aug 11 '15 at 16:16
  • 1
    To implement idempotet service calls, you need to include some kind of request id with your calls, so that the server side can determine if the specific request has been processed before or not. If you use `PUT` the URI may be unique per request; alternatively, you can of course include a dedicated field in the payload to hold the request id. – JimmyB Aug 12 '15 at 14:16
  • I think I'm getting the hang of it. Thanks. Can you write an answer so that I can mark it as the right answer? – Tushar Nallan Aug 13 '15 at 07:42

0 Answers0