Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
fix: wait endlessly by default
Browse files Browse the repository at this point in the history
  • Loading branch information
miwurster committed Jan 19, 2023
1 parent 5332cfe commit 64e794f
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions planqk/qiskit/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from planqk.client import logger, PlanqkClient

DEFAULT_TIMEOUT = 300 # Default timeout for waiting for job to complete


class ErrorData(object):
def __init__(self, code: str, message: str):
Expand Down Expand Up @@ -86,12 +84,7 @@ def _update_job_details(self,
self.tags = tags
self.error_data = error_data

def wait_until_completed(
self,
max_poll_wait_secs=30,
timeout_secs=None,
print_progress=True
) -> None:
def wait_until_completed(self, max_poll_wait_secs=30, timeout_secs=None) -> None:
"""
Wait until the job has completed.
"""
Expand All @@ -102,8 +95,6 @@ def wait_until_completed(
if timeout_secs is not None and total_time >= timeout_secs:
raise TimeoutError(f"The wait time has exceeded {timeout_secs} seconds.")
logger.debug(f"Waiting for job {self.id}; it is in status '{self.status}'")
if print_progress:
print(".", end="", flush=True)
time.sleep(poll_wait)
total_time += poll_wait
self.refresh()
Expand Down Expand Up @@ -132,7 +123,7 @@ def cancel(self):
"""
self._client.cancel_job(self.job_id)

def results(self, timeout_secs: float = DEFAULT_TIMEOUT) -> dict:
def results(self, timeout_secs: float = None) -> dict:
"""
Return the results of the job.
"""
Expand Down

0 comments on commit 64e794f

Please sign in to comment.