Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client/src/schedule-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export class ScheduleClient extends BaseClient {
policies: {
// 'overlap' should never be missing on describe, as the server will replace UNSPECIFIED by an actual value
overlap: decodeScheduleOverlapPolicy(raw.schedule.policies?.overlapPolicy) ?? ScheduleOverlapPolicy.SKIP,
catchupWindow: optionalTsToMs(raw.schedule.policies?.catchupWindow) ?? 60_000,
catchupWindow: optionalTsToMs(raw.schedule.policies?.catchupWindow) ?? 365 * 24 * 60 * 60 * 1000,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the server have some form of configuration for that default value? e.g. dynamic config?

If so, then we'd better let that undefined if not explicitly specified by the user, so that the server's default applies.

pauseOnFailure: raw.schedule.policies?.pauseOnFailure === true,
},
state: {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/schedule-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export interface ScheduleOptions<A extends ScheduleOptionsAction = ScheduleOptio
/**
* The Temporal Server might be down or unavailable at the time when a Schedule should take an Action. When the Server
* comes back up, `catchupWindow` controls which missed Actions should be taken at that point. The default is one
* minute, which means that the Schedule attempts to take any Actions that wouldn't be more than one minute late. It
* year, which means that the Schedule attempts to take any Actions that wouldn't be more than one year late. It
* takes those Actions according to the {@link ScheduleOverlapPolicy}. An outage that lasts longer than the Catchup
* Window could lead to missed Actions. (But you can always {@link ScheduleHandle.backfill}.)
*
* @default 1 year
* When unset, this field is omitted so the Temporal Server applies its default (currently one year).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is inconsistent with the code currently in schedule-client.ts (see my comment at line 440).

* @format number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}
*/
catchupWindow?: Duration;
Expand Down
1 change: 1 addition & 0 deletions packages/test/src/test-schedules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ if (RUN_INTEGRATION_TESTS) {
t.deepEqual(describedSchedule.spec.calendars, [
{ ...calendarSpecDescriptionDefaults, hour: [{ start: 2, end: 7, step: 1 }] },
]);
t.is(describedSchedule.policies.catchupWindow, 365 * 24 * 60 * 60 * 1000);
} finally {
await handle.delete();
}
Expand Down
Loading