iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inactivity timeout sometimes triggers immediately

grimborg opened this issue · comments

When setting timeout_ms = 60000 and since = 0, the timeout sometimes immediately (on the same second), even if there are changes. This doesn't happen all the time, and I can't manage to reproduce it consistently except on a running system where after ~1day it will consistantly fail.

The way I use it:

  • Create a feed with the specified parameters.
  • Define on_timeout handler which calls removeAllListeners and stop (and deletes the feed).
  • Start the feed.
  • Later, after a (real) timeout, repeat the process.

At some point, the timeout is triggered always immediately. Restarting the process fixes it.