Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
5 changes: 2 additions & 3 deletions spec/v2/providers/scheduler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ describe("schedule", () => {
expect(schedule.getOpts(options)).to.deep.eq({
schedule: "* * * * *",
timeZone: "utc",
attemptDeadlineSeconds: undefined,
retryConfig: {
retryCount: 3,
maxRetrySeconds: 1,
Expand Down Expand Up @@ -110,7 +109,7 @@ describe("schedule", () => {
{
schedule: "* * * * *",
timeZone: "utc",
attemptDeadlineSeconds: 300,
timeoutSeconds: 300,
retryCount: 3,
maxRetrySeconds: 10,
minBackoffSeconds: 11,
Expand All @@ -127,6 +126,7 @@ describe("schedule", () => {
platform: "gcfv2",
labels: { key: "val" },
region: ["us-central1"],
timeoutSeconds: 300,
scheduleTrigger: {
schedule: "* * * * *",
timeZone: "utc",
Expand Down Expand Up @@ -163,7 +163,6 @@ describe("schedule", () => {
scheduleTrigger: {
schedule: "* * * * *",
timeZone: undefined,
attemptDeadlineSeconds: undefined,
retryConfig: {
retryCount: undefined,
maxRetrySeconds: undefined,
Expand Down
13 changes: 4 additions & 9 deletions src/v2/providers/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
interface SeparatedOpts {
schedule: string | Expression<string>;
timeZone?: timezone | Expression<string> | ResetValue;
attemptDeadlineSeconds?: number | Expression<number> | ResetValue;
retryConfig?: {
retryCount?: number | Expression<number> | ResetValue;
maxRetrySeconds?: number | Expression<number> | ResetValue;
Expand All @@ -64,7 +63,6 @@
return {
schedule: args.schedule,
timeZone: args.timeZone,
attemptDeadlineSeconds: args.attemptDeadlineSeconds,
retryConfig: {
retryCount: args.retryCount,
maxRetrySeconds: args.maxRetrySeconds,
Expand Down Expand Up @@ -113,13 +111,7 @@
/** The timezone that the schedule executes in. */
timeZone?: timezone | Expression<string> | ResetValue;

/**
* The deadline for job attempts in seconds. If the request handler does not respond by this deadline,
* the request is cancelled and the attempt is marked as a `DEADLINE_EXCEEDED` failure.
* The value must be between 15 and 1800. Defaults to 180.
*/
attemptDeadlineSeconds?: number | Expression<number> | ResetValue;

Check failure on line 114 in src/v2/providers/scheduler.ts

View workflow job for this annotation

GitHub Actions / lint (22.x)

Delete `⏎`
/** The number of retry attempts for a failed run. */
retryCount?: number | Expression<number> | ResetValue;

Expand Down Expand Up @@ -205,7 +197,10 @@
scheduleTrigger: initV2ScheduleTrigger(separatedOpts.schedule, globalOpts, separatedOpts.opts),
};

copyIfPresent(ep.scheduleTrigger, separatedOpts, "timeZone", "attemptDeadlineSeconds");
copyIfPresent(ep.scheduleTrigger, separatedOpts, "timeZone");
if (ep.timeoutSeconds) {
ep.scheduleTrigger.attemptDeadlineSeconds = ep.timeoutSeconds;
}
copyIfPresent(
ep.scheduleTrigger.retryConfig,
separatedOpts.retryConfig,
Expand Down
Loading