2020from openeo .internal .warnings import deprecated , legacy_alias
2121from openeo .rest import (
2222 DEFAULT_DOWNLOAD_CHUNK_SIZE ,
23+ DEFAULT_JOB_STATUS_POLL_CONNECTION_RETRY_INTERVAL ,
24+ DEFAULT_JOB_STATUS_POLL_INTERVAL_MAX ,
25+ DEFAULT_JOB_STATUS_POLL_SOFT_ERROR_MAX ,
2326 JobFailedException ,
2427 OpenEoApiError ,
2528 OpenEoApiPlainError ,
@@ -223,16 +226,16 @@ def run_synchronous(
223226 self ,
224227 outputfile : Union [str , Path , None ] = None ,
225228 print = print ,
226- max_poll_interval = 60 ,
227- connection_retry_interval = 30 ,
229+ max_poll_interval : float = DEFAULT_JOB_STATUS_POLL_INTERVAL_MAX ,
230+ connection_retry_interval : float = DEFAULT_JOB_STATUS_POLL_CONNECTION_RETRY_INTERVAL ,
228231 show_error_logs : bool = True ,
229232 ) -> BatchJob :
230233 """
231234 Start the job, wait for it to finish and download result
232235
233236 :param outputfile: The path of a file to which a result can be written
234237 :param print: print/logging function to show progress/status
235- :param max_poll_interval: maximum number of seconds to sleep between status polls
238+ :param max_poll_interval: maximum number of seconds to sleep between job status polls
236239 :param connection_retry_interval: how long to wait when status poll failed due to connection issue
237240 :param show_error_logs: whether to automatically print error logs when the batch job failed.
238241
@@ -253,16 +256,16 @@ def run_synchronous(
253256 def start_and_wait (
254257 self ,
255258 print = print ,
256- max_poll_interval : int = 60 ,
257- connection_retry_interval : int = 30 ,
258- soft_error_max = 10 ,
259+ max_poll_interval : float = DEFAULT_JOB_STATUS_POLL_INTERVAL_MAX ,
260+ connection_retry_interval : float = DEFAULT_JOB_STATUS_POLL_CONNECTION_RETRY_INTERVAL ,
261+ soft_error_max : int = DEFAULT_JOB_STATUS_POLL_SOFT_ERROR_MAX ,
259262 show_error_logs : bool = True ,
260263 ) -> BatchJob :
261264 """
262265 Start the batch job, poll its status and wait till it finishes (or fails)
263266
264267 :param print: print/logging function to show progress/status
265- :param max_poll_interval: maximum number of seconds to sleep between status polls
268+ :param max_poll_interval: maximum number of seconds to sleep between job status polls
266269 :param connection_retry_interval: how long to wait when status poll failed due to connection issue
267270 :param soft_error_max: maximum number of soft errors (e.g. temporary connection glitches) to allow
268271 :param show_error_logs: whether to automatically print error logs when the batch job failed.
0 commit comments