Category Archives: Uncategorized

Déjà vu

Some time ago i experienced a very baffling phenomenon when debugging my node.js application.
after some time, node started rerunning the code that had already been executed.
I had no idea what could cause this behavior!
Turns out that when the response times out, node.js re-sends the request.
In order to prevent this problem, when you have a script with long execution time, use res.setTimeout with a large number.