@@ -48,6 +48,7 @@ interface SeparatedOpts {
4848 minBackoffSeconds ?: number | Expression < number > | ResetValue ;
4949 maxBackoffSeconds ?: number | Expression < number > | ResetValue ;
5050 maxDoublings ?: number | Expression < number > | ResetValue ;
51+ attemptDeadline ?: string | Expression < string > | ResetValue ;
5152 } ;
5253 opts : options . GlobalOptions ;
5354}
@@ -60,16 +61,22 @@ export function getOpts(args: string | ScheduleOptions): SeparatedOpts {
6061 opts : { } as options . GlobalOptions ,
6162 } ;
6263 }
64+ const retryConfig : any = {
65+ retryCount : args . retryCount ,
66+ maxRetrySeconds : args . maxRetrySeconds ,
67+ minBackoffSeconds : args . minBackoffSeconds ,
68+ maxBackoffSeconds : args . maxBackoffSeconds ,
69+ maxDoublings : args . maxDoublings ,
70+ } ;
71+
72+ if ( args . attemptDeadline !== undefined ) {
73+ retryConfig . attemptDeadline = args . attemptDeadline ;
74+ }
75+
6376 return {
6477 schedule : args . schedule ,
6578 timeZone : args . timeZone ,
66- retryConfig : {
67- retryCount : args . retryCount ,
68- maxRetrySeconds : args . maxRetrySeconds ,
69- minBackoffSeconds : args . minBackoffSeconds ,
70- maxBackoffSeconds : args . maxBackoffSeconds ,
71- maxDoublings : args . maxDoublings ,
72- } ,
79+ retryConfig,
7380 opts : args as options . GlobalOptions ,
7481 } ;
7582}
@@ -125,6 +132,12 @@ export interface ScheduleOptions extends options.GlobalOptions {
125132
126133 /** The time between will double max doublings times. */
127134 maxDoublings ?: number | Expression < number > | ResetValue ;
135+
136+ /**
137+ * The deadline for each job attempt, specified as a duration string (e.g. "600s").
138+ * See: https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs#Job
139+ */
140+ attemptDeadline ?: string | Expression < string > | ResetValue ;
128141}
129142
130143/**
@@ -204,7 +217,8 @@ export function onSchedule(
204217 "maxRetrySeconds" ,
205218 "minBackoffSeconds" ,
206219 "maxBackoffSeconds" ,
207- "maxDoublings"
220+ "maxDoublings" ,
221+ "attemptDeadline"
208222 ) ;
209223 func . __endpoint = ep ;
210224
0 commit comments