iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower
Apache License 2.0
393 stars 82 forks source link

Retry doesn't do exponential fallback for views #63

Open grimborg opened 9 years ago

grimborg commented 9 years ago

According to the documentation retry uses a "exponential fallback schedule", but I'm seeing that the delay between retries stays at always 1000ms. The reason is that if CouchDB returns a 200 with a null body (as it does for me), it's considered what the debug message calls a 'Good response', which restarts the retry delay. And because it's not really a good response, it retries anyway (as it should). This happens whenever I follow a view which does not exist.

If I change it so that the delay is not reset on an empty body it just retries continuously without waiting until it reaches the maximum.

Thoughts?