[28/50] git commit: Add heartbeat parameter to all _changes requests

2012-01-22 Thread fdmanana
Add heartbeat parameter to all _changes requests

Even non-continuous _changes requests, particularly filtered
ones, can cause long periods of inactivity.


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

Branch: refs/heads/COUCHDB-1342
Commit: a2d57c8bb34f4621fed00f4e65191a1531bc3110
Parents: 975ea08
Author: Filipe David Borba Manana fdman...@apache.org
Authored: Sat Jan 7 13:44:45 2012 +
Committer: Filipe David Borba Manana fdman...@apache.org
Committed: Sat Jan 7 13:44:45 2012 +

--
 .../src/couch_replicator_api_wrap.erl  |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2d57c8b/src/couch_replicator/src/couch_replicator_api_wrap.erl
--
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl 
b/src/couch_replicator/src/couch_replicator_api_wrap.erl
index a29fe94..d287fcb 100644
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl
@@ -306,13 +306,15 @@ update_docs(Db, DocList, Options, UpdateType) -
 
 changes_since(#httpdb{headers = Headers1} = HttpDb, Style, StartSeq,
 UserFun, Options) -
+HeartBeat = erlang:max(1000, HttpDb#httpdb.timeout div 3),
 BaseQArgs = case get_value(continuous, Options, false) of
 false -
 [{feed, normal}];
 true -
-[{feed, continuous}, {heartbeat, 1}]
+[{feed, continuous}]
 end ++ [
-{style, atom_to_list(Style)}, {since, couch_util:to_list(StartSeq)}
+{style, atom_to_list(Style)}, {since, 
couch_util:to_list(StartSeq)},
+{heartbeat, integer_to_list(HeartBeat)}
 ],
 DocIds = get_value(doc_ids, Options),
 {QArgs, Method, Body, Headers} = case DocIds of



git commit: Add heartbeat parameter to all _changes requests

2012-01-07 Thread fdmanana
Updated Branches:
  refs/heads/master 975ea08c7 - a2d57c8bb


Add heartbeat parameter to all _changes requests

Even non-continuous _changes requests, particularly filtered
ones, can cause long periods of inactivity.


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

Branch: refs/heads/master
Commit: a2d57c8bb34f4621fed00f4e65191a1531bc3110
Parents: 975ea08
Author: Filipe David Borba Manana fdman...@apache.org
Authored: Sat Jan 7 13:44:45 2012 +
Committer: Filipe David Borba Manana fdman...@apache.org
Committed: Sat Jan 7 13:44:45 2012 +

--
 .../src/couch_replicator_api_wrap.erl  |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a2d57c8b/src/couch_replicator/src/couch_replicator_api_wrap.erl
--
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl 
b/src/couch_replicator/src/couch_replicator_api_wrap.erl
index a29fe94..d287fcb 100644
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl
@@ -306,13 +306,15 @@ update_docs(Db, DocList, Options, UpdateType) -
 
 changes_since(#httpdb{headers = Headers1} = HttpDb, Style, StartSeq,
 UserFun, Options) -
+HeartBeat = erlang:max(1000, HttpDb#httpdb.timeout div 3),
 BaseQArgs = case get_value(continuous, Options, false) of
 false -
 [{feed, normal}];
 true -
-[{feed, continuous}, {heartbeat, 1}]
+[{feed, continuous}]
 end ++ [
-{style, atom_to_list(Style)}, {since, couch_util:to_list(StartSeq)}
+{style, atom_to_list(Style)}, {since, 
couch_util:to_list(StartSeq)},
+{heartbeat, integer_to_list(HeartBeat)}
 ],
 DocIds = get_value(doc_ids, Options),
 {QArgs, Method, Body, Headers} = case DocIds of



git commit: Add heartbeat parameter to all _changes requests

2012-01-07 Thread randall
Updated Branches:
  refs/heads/1.2.x 3587e084e - 08d8f89cc


Add heartbeat parameter to all _changes requests

Even non-continuous _changes requests, particularly filtered
ones, can cause long periods of inactivity.


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

Branch: refs/heads/1.2.x
Commit: 08d8f89cc07920b89b01145268a5b3453837fa82
Parents: 3587e08
Author: Filipe David Borba Manana fdman...@apache.org
Authored: Sat Jan 7 13:44:45 2012 +
Committer: Randall Leeds rand...@apache.org
Committed: Sat Jan 7 12:54:02 2012 -0800

--
 src/couchdb/couch_api_wrap.erl |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/couchdb/blob/08d8f89c/src/couchdb/couch_api_wrap.erl
--
diff --git a/src/couchdb/couch_api_wrap.erl b/src/couchdb/couch_api_wrap.erl
index 75436ff..0607d50 100644
--- a/src/couchdb/couch_api_wrap.erl
+++ b/src/couchdb/couch_api_wrap.erl
@@ -308,13 +308,15 @@ update_docs(Db, DocList, Options, UpdateType) -
 
 changes_since(#httpdb{headers = Headers1} = HttpDb, Style, StartSeq,
 UserFun, Options) -
+HeartBeat = erlang:max(1000, HttpDb#httpdb.timeout div 3),
 BaseQArgs = case get_value(continuous, Options, false) of
 false -
 [{feed, normal}];
 true -
-[{feed, continuous}, {heartbeat, 1}]
+[{feed, continuous}]
 end ++ [
-{style, atom_to_list(Style)}, {since, couch_util:to_list(StartSeq)}
+{style, atom_to_list(Style)}, {since, 
couch_util:to_list(StartSeq)},
+{heartbeat, integer_to_list(HeartBeat)}
 ],
 DocIds = get_value(doc_ids, Options),
 {QArgs, Method, Body, Headers} = case DocIds of