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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s