0

I am getting the following error in my machine when I run my code locally.

The server did not return a complete response for this request. Server returned 0 
bytes.

my code is a for loop which loops around 1 million time inserting objects in my array.

So what is the problem here please.

Dev
  • 1,861
  • 2
  • 14
  • 20
  • The problem is possibly a timeout? – Rob Meeuwisse Oct 07 '15 at 23:29
  • Is it ?? how to change the timeout value in my local server? – Dev Oct 07 '15 at 23:30
  • 1
    It's just a hypothesis. To test it you could change your code temporarily to just insert a single object so it is finished quickly. – Rob Meeuwisse Oct 07 '15 at 23:31
  • You are right @RobMeeuwisse, I am calling methods to do some calculations inside my loops, that's why it takes longer time...I tried to optimize them....so what to do if I have to keep them as is – Dev Oct 07 '15 at 23:38
  • It depends. I googled a bit, apparently you can set the response timeout if you are using ExpressJS, see [link](http://stackoverflow.com/questions/21708208/express-js-response-timeout) – Rob Meeuwisse Oct 07 '15 at 23:44
  • Another approach would be to store the incoming request in a database and respond quickly with 202 Accepted. Then in a background worker do the long running work for the request. – Rob Meeuwisse Oct 07 '15 at 23:46
  • cool, I will try this also.... any other ideas :) – Dev Oct 07 '15 at 23:57

0 Answers0