Skip to content

Commit

Permalink
add default value param to preserver backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MehmedGIT committed Oct 1, 2024
1 parent 7177eb1 commit df8e8ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ocrd_network/client_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from .constants import JobState, NETWORK_PROTOCOLS


def _poll_endpoint_status(ps_server_host: str, job_id: str, job_type: str, tries: int, wait: int, print_output: bool):
def _poll_endpoint_status(
ps_server_host: str, job_id: str, job_type: str, tries: int, wait: int, print_output: bool = False):
if job_type not in ["workflow", "processor"]:
raise ValueError(f"Unknown job type '{job_type}', expected 'workflow' or 'processor'")
job_state = JobState.unset
Expand All @@ -22,12 +23,12 @@ def _poll_endpoint_status(ps_server_host: str, job_id: str, job_type: str, tries


def poll_job_status_till_timeout_fail_or_success(
ps_server_host: str, job_id: str, tries: int, wait: int, print_output: bool) -> JobState:
ps_server_host: str, job_id: str, tries: int, wait: int, print_output: bool = False) -> JobState:
return _poll_endpoint_status(ps_server_host, job_id, "processor", tries, wait, print_output)


def poll_wf_status_till_timeout_fail_or_success(
ps_server_host: str, job_id: str, tries: int, wait: int, print_output: bool) -> JobState:
ps_server_host: str, job_id: str, tries: int, wait: int, print_output: bool = False) -> JobState:
return _poll_endpoint_status(ps_server_host, job_id, "workflow", tries, wait, print_output)


Expand Down

0 comments on commit df8e8ee

Please sign in to comment.