Disable _changes feed termination by default

This relies on the fact that the atom 'infinity' sorts above all
numbers in Erlang.

BugzID: 17682


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/97de5ef1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/97de5ef1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/97de5ef1

Branch: refs/heads/import
Commit: 97de5ef13c1321ac08af932c7f001efdfd4c6667
Parents: 76ba13c
Author: Adam Kocoloski <a...@cloudant.com>
Authored: Thu Feb 28 00:34:38 2013 -0500
Committer: Adam Kocoloski <a...@cloudant.com>
Committed: Thu Feb 28 00:34:38 2013 -0500

----------------------------------------------------------------------
 src/fabric_view_changes.erl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/97de5ef1/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index 13e8fcc..d242fcd 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -83,9 +83,12 @@ keep_sending_changes(DbName, Args, Callback, Seqs, AccIn, 
Timeout, UpListen, T0)
     true ->
         WaitForUpdate = wait_db_updated(UpListen),
         AccumulatedTime = timer:now_diff(os:timestamp(), T0) div 1000,
-        Max = list_to_integer(
-            config:get("fabric", "changes_duration", "300000")
-        ),
+        Max = case config:get("fabric", "changes_duration") of
+        undefined ->
+            infinity;
+        MaxStr ->
+            list_to_integer(MaxStr)
+        end,
         case {Heartbeat, AccumulatedTime > Max, WaitForUpdate} of
         {undefined, _, timeout} ->
             Callback({stop, LastSeq}, AccOut);

Reply via email to