[
https://issues.apache.org/jira/browse/COUCHDB-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108477#comment-13108477
]
Filipe Manana commented on COUCHDB-1289:
----------------------------------------
Good finding Bob.
What about using a simple function that is called before processing each
changes row and uses the process dictionary to reduce code size/complexity,
along the lines:
maybe_timeout(TimeoutFun) ->
Now = now(),
Before = case get(changes_timeout) of
undefined ->
Now;
OldNow ->
OldNow
end,
case timer:diff(Now, Before) >= Timeout of
true ->
Acc2 = TimeoutFun(get(changes_user_acc))
put(changes_timeout(Now)),
put(changes_user_acc, Acc2);
false ->
ok
end.
Probably it misses some cases, i haven't thought about this issue before.
> heartbeats skipped when continuous changes feed filter function produces no
> results
> -----------------------------------------------------------------------------------
>
> Key: COUCHDB-1289
> URL: https://issues.apache.org/jira/browse/COUCHDB-1289
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core
> Reporter: Bob Dionne
> Assignee: Bob Dionne
> Priority: Minor
>
> if the changes feed has a filter function that produces no results,
> db_updated messages will still be sent and the heartbeat timeout will never
> be reached.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira