@@ -38,6 +38,8 @@ def get_task_representation(
3838 actor_standby_idle_timeout_secs : int | None = None ,
3939 actor_standby_build : str | None = None ,
4040 actor_standby_memory_mbytes : int | None = None ,
41+ * ,
42+ restart_on_error : bool | None = None ,
4143) -> dict :
4244 """Get the dictionary representation of a task."""
4345 return {
@@ -48,6 +50,7 @@ def get_task_representation(
4850 'maxItems' : max_items ,
4951 'memoryMbytes' : memory_mbytes ,
5052 'timeoutSecs' : timeout_secs ,
53+ 'restartOnError' : restart_on_error ,
5154 },
5255 'input' : task_input ,
5356 'title' : title ,
@@ -87,6 +90,7 @@ def update(
8790 max_items : int | None = None ,
8891 memory_mbytes : int | None = None ,
8992 timeout_secs : int | None = None ,
93+ restart_on_error : bool | None = None ,
9094 title : str | None = None ,
9195 actor_standby_desired_requests_per_actor_run : int | None = None ,
9296 actor_standby_max_requests_per_actor_run : int | None = None ,
@@ -108,6 +112,8 @@ def update(
108112 in the task settings.
109113 timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
110114 in the task settings.
115+ restart_on_error: If true, the Task run process will be restarted whenever it exits with
116+ a non-zero status code.
111117 task_input: Task input dictionary.
112118 title: A human-friendly equivalent of the name.
113119 actor_standby_desired_requests_per_actor_run: The desired number of concurrent HTTP requests for
@@ -129,6 +135,7 @@ def update(
129135 max_items = max_items ,
130136 memory_mbytes = memory_mbytes ,
131137 timeout_secs = timeout_secs ,
138+ restart_on_error = restart_on_error ,
132139 title = title ,
133140 actor_standby_desired_requests_per_actor_run = actor_standby_desired_requests_per_actor_run ,
134141 actor_standby_max_requests_per_actor_run = actor_standby_max_requests_per_actor_run ,
@@ -154,6 +161,7 @@ def start(
154161 max_items : int | None = None ,
155162 memory_mbytes : int | None = None ,
156163 timeout_secs : int | None = None ,
164+ restart_on_error : bool | None = None ,
157165 wait_for_finish : int | None = None ,
158166 webhooks : list [dict ] | None = None ,
159167 ) -> dict :
@@ -171,6 +179,8 @@ def start(
171179 in the task settings.
172180 timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
173181 in the task settings.
182+ restart_on_error: If true, the Task run process will be restarted whenever it exits with
183+ a non-zero status code.
174184 wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
175185 it is 0, the maximum value is 60.
176186 webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
@@ -189,6 +199,7 @@ def start(
189199 maxItems = max_items ,
190200 memory = memory_mbytes ,
191201 timeout = timeout_secs ,
202+ restartOnError = restart_on_error ,
192203 waitForFinish = wait_for_finish ,
193204 webhooks = encode_webhook_list_to_base64 (webhooks ) if webhooks is not None else None ,
194205 )
@@ -211,6 +222,7 @@ def call(
211222 max_items : int | None = None ,
212223 memory_mbytes : int | None = None ,
213224 timeout_secs : int | None = None ,
225+ restart_on_error : bool | None = None ,
214226 webhooks : list [dict ] | None = None ,
215227 wait_secs : int | None = None ,
216228 ) -> dict | None :
@@ -230,6 +242,8 @@ def call(
230242 in the task settings.
231243 timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
232244 in the task settings.
245+ restart_on_error: If true, the Task run process will be restarted whenever it exits with
246+ a non-zero status code.
233247 webhooks: Specifies optional webhooks associated with the Actor run, which can be used to receive
234248 a notification e.g. when the Actor finished or failed. Note: if you already have a webhook set up for
235249 the Actor or task, you do not have to add it again here.
@@ -245,6 +259,7 @@ def call(
245259 max_items = max_items ,
246260 memory_mbytes = memory_mbytes ,
247261 timeout_secs = timeout_secs ,
262+ restart_on_error = restart_on_error ,
248263 webhooks = webhooks ,
249264 )
250265
@@ -343,6 +358,7 @@ async def update(
343358 max_items : int | None = None ,
344359 memory_mbytes : int | None = None ,
345360 timeout_secs : int | None = None ,
361+ restart_on_error : bool | None = None ,
346362 title : str | None = None ,
347363 actor_standby_desired_requests_per_actor_run : int | None = None ,
348364 actor_standby_max_requests_per_actor_run : int | None = None ,
@@ -364,6 +380,8 @@ async def update(
364380 in the task settings.
365381 timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
366382 in the task settings.
383+ restart_on_error: If true, the Task run process will be restarted whenever it exits with
384+ a non-zero status code.
367385 task_input: Task input dictionary.
368386 title: A human-friendly equivalent of the name.
369387 actor_standby_desired_requests_per_actor_run: The desired number of concurrent HTTP requests for
@@ -385,6 +403,7 @@ async def update(
385403 max_items = max_items ,
386404 memory_mbytes = memory_mbytes ,
387405 timeout_secs = timeout_secs ,
406+ restart_on_error = restart_on_error ,
388407 title = title ,
389408 actor_standby_desired_requests_per_actor_run = actor_standby_desired_requests_per_actor_run ,
390409 actor_standby_max_requests_per_actor_run = actor_standby_max_requests_per_actor_run ,
@@ -410,6 +429,7 @@ async def start(
410429 max_items : int | None = None ,
411430 memory_mbytes : int | None = None ,
412431 timeout_secs : int | None = None ,
432+ restart_on_error : bool | None = None ,
413433 wait_for_finish : int | None = None ,
414434 webhooks : list [dict ] | None = None ,
415435 ) -> dict :
@@ -427,6 +447,8 @@ async def start(
427447 in the task settings.
428448 timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
429449 in the task settings.
450+ restart_on_error: If true, the Task run process will be restarted whenever it exits with
451+ a non-zero status code.
430452 wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
431453 it is 0, the maximum value is 60.
432454 webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
@@ -445,6 +467,7 @@ async def start(
445467 maxItems = max_items ,
446468 memory = memory_mbytes ,
447469 timeout = timeout_secs ,
470+ restartOnError = restart_on_error ,
448471 waitForFinish = wait_for_finish ,
449472 webhooks = encode_webhook_list_to_base64 (webhooks ) if webhooks is not None else None ,
450473 )
@@ -467,6 +490,7 @@ async def call(
467490 max_items : int | None = None ,
468491 memory_mbytes : int | None = None ,
469492 timeout_secs : int | None = None ,
493+ restart_on_error : bool | None = None ,
470494 webhooks : list [dict ] | None = None ,
471495 wait_secs : int | None = None ,
472496 ) -> dict | None :
@@ -486,6 +510,8 @@ async def call(
486510 in the task settings.
487511 timeout_secs: Optional timeout for the run, in seconds. By default, the run uses timeout specified
488512 in the task settings.
513+ restart_on_error: If true, the Task run process will be restarted whenever it exits with
514+ a non-zero status code.
489515 webhooks: Specifies optional webhooks associated with the Actor run, which can be used to receive
490516 a notification e.g. when the Actor finished or failed. Note: if you already have a webhook set up for
491517 the Actor or task, you do not have to add it again here.
@@ -501,6 +527,7 @@ async def call(
501527 max_items = max_items ,
502528 memory_mbytes = memory_mbytes ,
503529 timeout_secs = timeout_secs ,
530+ restart_on_error = restart_on_error ,
504531 webhooks = webhooks ,
505532 )
506533
0 commit comments