rnewson commented on code in PR #5881:
URL: https://github.com/apache/couchdb/pull/5881#discussion_r2801237093


##########
src/couch_replicator/src/couch_replicator_scheduler_job.erl:
##########
@@ -684,7 +684,16 @@ init_state(Rep) ->
         end,
     Stats = couch_replicator_stats:max_stats(ArgStats1, HistoryStats),
 
-    StartSeq1 = get_value(since_seq, Options, StartSeq0),
+    StartSeq1 =
+        case StartSeq0 of
+            0 ->
+                % Checkpoint doesn't exist, use the `since_seq` to replicate;
+                % If `since_seq` is not defined, replicate from scratch.
+                get_value(since_seq, Options, StartSeq0);

Review Comment:
   since we know StartSeq0 is 0 this line would read more clearly as 
`get_value(since_seq, Options, 0)` imo.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to