@@ -711,8 +711,8 @@ async def start(
711
711
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit specified
712
712
in the default run configuration for the Actor.
713
713
timeout: Optional timeout for the run, in seconds. By default, the run uses timeout specified in
714
- the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other actor
715
- to the time remaining from this actor timeout.
714
+ the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other Actor
715
+ to the time remaining from this Actor timeout.
716
716
wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
717
717
it is 0, the maximum value is 300.
718
718
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
@@ -740,9 +740,7 @@ async def start(
740
740
elif isinstance (timeout , timedelta ):
741
741
actor_start_timeout = timeout
742
742
else :
743
- raise ValueError (
744
- f'Invalid timeout { timeout !r} : expected `None`, `"RemainingTime"`, or a `timedelta`.'
745
- )
743
+ raise ValueError (f'Invalid timeout { timeout !r} : expected `None`, `"RemainingTime"`, or a `timedelta`.' )
746
744
747
745
api_result = await client .actor (actor_id ).start (
748
746
run_input = run_input ,
@@ -761,7 +759,11 @@ def _get_remaining_time(self) -> timedelta | None:
761
759
if self .is_at_home () and self .configuration .timeout_at :
762
760
return self .configuration .timeout_at - datetime .now (tz = timezone .utc )
763
761
764
- self .log .warning ('Using `RemainingTime` argument for timeout outside of the Apify platform. Returning `None`' )
762
+ self .log .warning (
763
+ 'Returning `None` instead of remaining time. Using `RemainingTime` argument is only possible when the Actor'
764
+ ' is running on the Apify platform and when the timeout for the Actor run is set. '
765
+ f'{ self .is_at_home ()= } , { self .configuration .timeout_at = } '
766
+ )
765
767
return None
766
768
767
769
async def abort (
@@ -825,8 +827,8 @@ async def call(
825
827
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit specified
826
828
in the default run configuration for the Actor.
827
829
timeout: Optional timeout for the run, in seconds. By default, the run uses timeout specified in
828
- the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other actor
829
- to the time remaining from this actor timeout.
830
+ the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other Actor
831
+ to the time remaining from this Actor timeout.
830
832
webhooks: Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, which can
831
833
be used to receive a notification, e.g. when the Actor finished or failed. If you already have
832
834
a webhook set up for the Actor, you do not have to add it again here.
@@ -849,12 +851,12 @@ async def call(
849
851
850
852
if timeout == 'RemainingTime' :
851
853
actor_call_timeout = self ._get_remaining_time ()
852
- elif isinstance (timeout , str ):
853
- raise ValueError (
854
- f'`timeout` can be `None`, `RemainingTime` literal or `timedelta` instance, but is { timeout = } '
855
- )
856
- else :
854
+ elif timeout is None :
855
+ actor_call_timeout = None
856
+ elif isinstance (timeout , timedelta ):
857
857
actor_call_timeout = timeout
858
+ else :
859
+ raise ValueError (f'Invalid timeout { timeout !r} : expected `None`, `"RemainingTime"`, or a `timedelta`.' )
858
860
859
861
api_result = await client .actor (actor_id ).call (
860
862
run_input = run_input ,
0 commit comments