Permalink
Browse files

Fix off by one error

That allowed the first doc to be copied over as TotalCopied begins with 0
  • Loading branch information...
Bob Dionne
Bob Dionne committed Sep 28, 2011
1 parent 41298f6 commit 60088312cd2bf14f792cdf88443028599ca2ac75
Showing with 2 additions and 2 deletions.
  1. +2 −2 apps/couch/src/couch_db_updater.erl
@@ -922,11 +922,11 @@ copy_compact_snapshot(DbSs, NewDb, Retry, TotalChanges) ->
couch_task_status:update(
"Copied ~p of ~p changes (~p%)",
[TotalCopied, TotalChanges, (TotalCopied*100) div TotalChanges]),
- if TotalCopied rem 1000 =:= 0 ->
+ if (TotalCopied + 1) rem 1000 =:= 0 ->
NewDb2 =
copy_docs(DbSs, AccNewDb,
lists:reverse([DocInfo | AccUncopied]), Retry),
- if TotalCopied rem 10000 =:= 0 ->
+ if (TotalCopied + 1) rem 10000 =:= 0 ->
NewDb3 = commit_data(NewDb2#db{update_seq=Seq}),
{ok, {NewDb3, [], TotalCopied + 1}};
true ->

0 comments on commit 6008831

Please sign in to comment.