Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #152 from cloudant/31725-since-now
Browse files Browse the repository at this point in the history
Support since=now
  • Loading branch information
rnewson committed Jun 16, 2014
2 parents ba24d71 + 7c9ea46 commit 0b7721e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/fabric_view_changes.erl
Expand Up @@ -339,11 +339,12 @@ make_changes_args(#changes_args{style=Style, filter=undefined}=Args) ->
make_changes_args(Args) ->
Args.

get_start_seq(_DbName, #changes_args{dir=fwd, since=Since}) ->
Since;
get_start_seq(DbName, #changes_args{dir=rev}) ->
get_start_seq(DbName, #changes_args{dir=Dir, since=Since})
when Dir == rev; Since == "now" ->
{ok, Info} = fabric:get_db_info(DbName),
couch_util:get_value(update_seq, Info).
couch_util:get_value(update_seq, Info);
get_start_seq(_DbName, #changes_args{dir=fwd, since=Since}) ->
Since.

pending_count(Dict) ->
fabric_dict:fold(fun
Expand Down Expand Up @@ -447,6 +448,8 @@ find_replacement_shards(#shard{range=Range}, AllShards) ->
% TODO make this moar betta -- we might have split or merged the partition
[Shard || Shard <- AllShards, Shard#shard.range =:= Range].

validate_start_seq(_DbName, "now") ->
ok;
validate_start_seq(DbName, Seq) ->
try unpack_seqs(Seq, DbName) of _Any ->
ok
Expand Down

0 comments on commit 0b7721e

Please sign in to comment.