Skip to content

Commit

Permalink
Send unset catchupWindow in schedules if not specified (#2067)
Browse files Browse the repository at this point in the history
If the catchupWindow property was not set in SchedulePolicy, it was sent as a zero duration in the appropriate protobuf message. However, the server expects an unset value here. The previous behavior led to setting the actual catchupWindow on the server to the minimal value (10 seconds) instead of the default (1 year).
  • Loading branch information
Duzhinsky authored May 21, 2024
1 parent 9cdff7a commit 9a856f3
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ public ScheduleAction actionToProto(io.temporal.client.schedules.ScheduleAction
}

public SchedulePolicies policyToProto(SchedulePolicy policy) {
return SchedulePolicies.newBuilder()
.setCatchupWindow(ProtobufTimeUtils.toProtoDuration(policy.getCatchupWindow()))
.setPauseOnFailure(policy.isPauseOnFailure())
.setOverlapPolicy(policy.getOverlap())
.build();
SchedulePolicies.Builder builder = SchedulePolicies.newBuilder();
if (policy.getCatchupWindow() != null) {
builder.setCatchupWindow(ProtobufTimeUtils.toProtoDuration(policy.getCatchupWindow()));
}
builder.setPauseOnFailure(policy.isPauseOnFailure());
builder.setOverlapPolicy(policy.getOverlap());
return builder.build();
}

public List<Range> scheduleRangeToProto(List<ScheduleRange> scheduleRanges) {
Expand Down

0 comments on commit 9a856f3

Please sign in to comment.