Skip to content

Commit

Permalink
Fix end_time field in /_replicate response
Browse files Browse the repository at this point in the history
Previously `end_time` was generated converting the start_time to universal,
then passing that to `httpd_util:rfc1123_date/1`. However, `rfc1123_date/1`
also transates its argument from local to UTC time, that is it accepts input to
be in local time format.

Fixes #1841
  • Loading branch information
nickva committed Jan 8, 2019
1 parent 72b788e commit 429864b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/couch_replicator/src/couch_replicator_scheduler_job.erl
Expand Up @@ -735,8 +735,8 @@ do_checkpoint(State) ->
{SrcInstanceStartTime, TgtInstanceStartTime} ->
couch_log:notice("recording a checkpoint for `~s` -> `~s` at source update_seq ~p",
[SourceName, TargetName, NewSeq]),
UniversalStartTime = calendar:now_to_universal_time(ReplicationStartTime),
StartTime = ?l2b(httpd_util:rfc1123_date(UniversalStartTime)),
LocalStartTime = calendar:now_to_local_time(ReplicationStartTime),
StartTime = ?l2b(httpd_util:rfc1123_date(LocalStartTime)),
EndTime = ?l2b(httpd_util:rfc1123_date()),
NewHistoryEntry = {[
{<<"session_id">>, SessionId},
Expand Down

0 comments on commit 429864b

Please sign in to comment.