Skip to content

Commit 1ed0cf7

Browse files
authored
Fix doc on v1 schedule configs (#1206)
* Add docs on schedule configs. * Fix typo.
1 parent 93d5b73 commit 1ed0cf7

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

src/v1/function-configuration.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,72 @@ export const INGRESS_SETTINGS_OPTIONS = [
7272
* Scheduler retry options. Applies only to scheduled functions.
7373
*/
7474
export interface ScheduleRetryConfig {
75+
/**
76+
* The number of attempts that the system will make to run a job using the exponential backoff procedure described by {@link ScheduleRetryConfig.maxDoublings}.
77+
*
78+
* @defaultValue 0 (infinite retry)
79+
*/
7580
retryCount?: number;
81+
/**
82+
* The time limit for retrying a failed job, measured from time when an execution was first attempted.
83+
*
84+
* If specified with {@link ScheduleRetryConfig.retryCount}, the job will be retried until both limits are reached.
85+
*
86+
* @defaultValue 0
87+
*/
7688
maxRetryDuration?: string;
89+
/**
90+
* The minimum amount of time to wait before retrying a job after it fails.
91+
*
92+
* @defaultValue 5 seconds
93+
*/
7794
minBackoffDuration?: string;
95+
/**
96+
* The maximum amount of time to wait before retrying a job after it fails.
97+
*
98+
* @defaultValue 1 hour
99+
*/
78100
maxBackoffDuration?: string;
101+
/**
102+
* The max number of backoff doubling applied at each retry.
103+
*
104+
* @defaultValue 5
105+
*/
79106
maxDoublings?: number;
80107
}
81108

82109
/**
83110
* Configuration options for scheduled functions.
84111
*/
85112
export interface Schedule {
113+
/**
114+
* Describes the schedule on which the job will be executed.
115+
*
116+
* The schedule can be either of the following types:
117+
*
118+
* 1. {@link https://en.wikipedia.org/wiki/Cron#Overview | Crontab}
119+
*
120+
* 2. English-like {@link https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules | schedule}
121+
*
122+
* @example
123+
* ```
124+
* // Crontab schedule
125+
* schedule: "0 9 * * 1"` // Every Monday at 09:00 AM
126+
*
127+
* // English-like schedule
128+
* schedule: "every 5 minutes"
129+
* ```
130+
*/
86131
schedule: string;
132+
/**
133+
* Specifies the time zone to be used in interpreting {@link Schedule.schedule}.
134+
*
135+
* The value of this field must be a time zone name from the tz database.
136+
*/
87137
timeZone?: string;
138+
/**
139+
* Settings that determine the retry behavior.
140+
*/
88141
retryConfig?: ScheduleRetryConfig;
89142
}
90143

0 commit comments

Comments
 (0)