Repository: Avaiga/taipy
File: taipy/core/_orchestrator/_orchestrator.py (Python)

Code before:
            cls._check_and_execute_jobs_if_development_mode()
        elif wait:
            cls._wait_until_job_finished(jobs, timeout)
        return submission

    @classmethod
    def submit_task(
        cls,
        task: Task,
        callbacks: Optional[Iterable[Callable]] = None,
        force: bool = False,
        wait: bool = False,
        timeout: Optional[Union[float, int]] = None,
        **properties,
    ) -> Submission:
        """Submit the given `Task^` for an execution.

        Parameters:
             task (Task^): The task to submit for execution.
             callbacks: The optional list of functions that should be executed on job status change.
             force (bool): Enforce execution of the task even if its output data nodes are cached.
             wait (bool): Wait for the orchestrated job created from the task submission to be finished
                in asynchronous mode.
             timeout (Union[float, int]): The optional maximum number of seconds to wait for the job
                to be finished before returning.
                If not provided and wait is True, the function waits indefinitely.
             **properties (dict[str, any]): A key worded variable length list of user additional arguments
                that will be stored within the `Submission^`. It can be accessed via `Submission.properties^`.
        Returns:
            The created `Submission^` containing the information about the submission.
        """
        submission = _SubmissionManagerFactory._build_manager()._create(
            task.id, task._ID_PREFIX, task.config_id, **properties
        )
        submit_id = submission.id
        with cls.lock:
            cls.__logger.debug(f"Acquiring lock to submit task {task.id}.")
            job = cls._lock_dn_output_and_create_job(
                task,
                submit_id,
                submission.entity_id,
                itertools.chain([cls._update_submission_status], callbacks or []),
                force,
            )
            jobs = [job]
            submission.jobs = jobs  # type: ignore
            cls._orchestrate_job_to_run_or_block(jobs)
        if Config.job_config.is_development:
            cls._check_and_execute_jobs_if_development_mode()
        else:
            if wait:

Review comment (suggestion):
```suggestion
                If not provided and *wait* is True, the function waits indefinitely.
```

Code after:
            cls._check_and_execute_jobs_if_development_mode()
        elif wait:
            cls._wait_until_job_finished(jobs, timeout)
        return submission

    @classmethod
    def submit_task(
        cls,
        task: Task,
        callbacks: Optional[Iterable[Callable]] = None,
        force: bool = False,
        wait: bool = False,
        timeout: Optional[Union[float, int]] = None,
        **properties,
    ) -> Submission:
        """Submit the given `Task^` for an execution.

        Parameters:
             task (Task^): The task to submit for execution.
             callbacks: The optional list of functions that should be executed on job status change.
             force (bool): Enforce execution of the task even if its output data nodes are cached.
             wait (bool): Wait for the orchestrated job created from the task submission to be finished
                in asynchronous mode.
             timeout (Union[float, int]): The optional maximum number of seconds to wait for the job
                to be finished before returning.<br/>
                If not provided and *wait* is True, the function waits indefinitely.
             **properties (dict[str, any]): A key worded variable length list of user additional arguments
                that will be stored within the `Submission^`. It can be accessed via `Submission.properties^`.
        Returns:
            The created `Submission^` containing the information about the submission.
        """
        submission = _SubmissionManagerFactory._build_manager()._create(
            task.id, task._ID_PREFIX, task.config_id, **properties
        )
        submit_id = submission.id
        with cls.lock:
            cls.__logger.debug(f"Acquiring lock to submit task {task.id}.")
            job = cls._lock_dn_output_and_create_job(
                task,
                submit_id,
                submission.entity_id,
                itertools.chain([cls._update_submission_status], callbacks or []),
                force,
            )
            jobs = [job]
            submission.jobs = jobs  # type: ignore
            cls._orchestrate_job_to_run_or_block(jobs)
        if Config.job_config.is_development:
            cls._check_and_execute_jobs_if_development_mode()
        else:
            if wait: