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

Code before:
    @classmethod
    def initialize(cls):
        pass

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

        Parameters:
             submittable (Union[Scenario^, Sequence^]): The scenario or sequence to submit for execution.
             callbacks: The optional list of functions that should be executed on jobs status change.
             force (bool) : Enforce execution of the scenario's or sequence's tasks even if their output data
                nodes are cached.
             wait (bool): Wait for the orchestrated jobs created from the scenario or sequence submission to be
                finished in asynchronous mode.
             timeout (Union[float, int]): The optional maximum number of seconds to wait for the jobs 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(
            submittable.id,  # type: ignore
            submittable._ID_PREFIX,  # type: ignore
            getattr(submittable, "config_id", None),
            **properties,
        )
        jobs: List[Job] = []
        tasks = submittable._get_sorted_tasks()
        with cls.lock:
            cls.__logger.debug(f"Acquiring lock to submit {submission.entity_id}.")
            for ts in tasks:
                jobs.extend(
                    cls._lock_dn_output_and_create_job(
                        task,
                        submission.id,
                        submission.entity_id,
                        callbacks=itertools.chain([cls._update_submission_status], callbacks or []),
                        force=force,  # type: ignore
                    )
                    for task in ts

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

Code after:
    @classmethod
    def initialize(cls):
        pass

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

        Parameters:
             submittable (Union[Scenario^, Sequence^]): The scenario or sequence to submit for execution.
             callbacks: The optional list of functions that should be executed on jobs status change.
             force (bool) : Enforce execution of the scenario's or sequence's tasks even if their output data
                nodes are cached.
             wait (bool): Wait for the orchestrated jobs created from the scenario or sequence submission to be
                finished in asynchronous mode.
             timeout (Union[float, int]): The optional maximum number of seconds to wait for the jobs 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(
            submittable.id,  # type: ignore
            submittable._ID_PREFIX,  # type: ignore
            getattr(submittable, "config_id", None),
            **properties,
        )
        jobs: List[Job] = []
        tasks = submittable._get_sorted_tasks()
        with cls.lock:
            cls.__logger.debug(f"Acquiring lock to submit {submission.entity_id}.")
            for ts in tasks:
                jobs.extend(
                    cls._lock_dn_output_and_create_job(
                        task,
                        submission.id,
                        submission.entity_id,
                        callbacks=itertools.chain([cls._update_submission_status], callbacks or []),
                        force=force,  # type: ignore
                    )
                    for task in ts