Skip to content

Commit bdc5222

Browse files
committed
feat: add maxItems and maxTotalChargeUsd to resurrect
1 parent 279238a commit bdc5222

File tree

1 file changed

+11
-1
lines changed
  • src/apify_client/clients/resource_clients

1 file changed

+11
-1
lines changed

src/apify_client/clients/resource_clients/run.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import random
55
import string
66
import time
7-
from typing import Any
7+
from typing import TYPE_CHECKING, Any
88

99
from apify_shared.utils import filter_out_none_values_recursively, ignore_docs, parse_date_fields
1010

@@ -15,6 +15,8 @@
1515
from apify_client.clients.resource_clients.log import LogClient, LogClientAsync
1616
from apify_client.clients.resource_clients.request_queue import RequestQueueClient, RequestQueueClientAsync
1717

18+
if TYPE_CHECKING:
19+
from decimal import Decimal
1820

1921
class RunClient(ActorJobBaseClient):
2022
"""Sub-client for manipulating a single Actor run."""
@@ -132,6 +134,8 @@ def resurrect(
132134
build: str | None = None,
133135
memory_mbytes: int | None = None,
134136
timeout_secs: int | None = None,
137+
max_items: int | None = None,
138+
max_total_charge_usd: Decimal | None = None,
135139
) -> dict:
136140
"""Resurrect a finished Actor run.
137141
@@ -147,6 +151,10 @@ def resurrect(
147151
uses the same memory limit as before.
148152
timeout_secs: New timeout for the resurrected run, in seconds. By default, the resurrected run uses the
149153
same timeout as before.
154+
max_items: Maximum number of items that the resurrected pay-per-result run will return. By default, the resurrected run
155+
uses the same limit as before. Limit can be only increased.
156+
max_total_charge_usd: Maximum cost for the resurrected pay-per-event run in USD. By default, the resurrected run
157+
uses the same limit as before. Limit can be only increased.
150158
151159
Returns:
152160
The Actor run data.
@@ -155,6 +163,8 @@ def resurrect(
155163
build=build,
156164
memory=memory_mbytes,
157165
timeout=timeout_secs,
166+
maxItems=max_items,
167+
maxTotalChargeUsd=max_total_charge_usd,
158168
)
159169

160170
response = self.http_client.call(

0 commit comments

Comments
 (0)