Skip to content

Commit

Permalink
ensure python 3.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
marcorossi5 committed Oct 21, 2024
1 parent 79d2338 commit c9672a6
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/qibo_client/qibo_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,17 @@ def _wait_for_response_to_get_request(
while True:
response = QiboApiRequest.get(url, timeout=constants.TIMEOUT)
job_status = convert_str_to_job_status(response.headers["Job-Status"])
if verbose:
match job_status:
case QiboJobStatus.QUEUEING:
logger.info("Job QUEUEING")
case QiboJobStatus.PENDING:
logger.info("Job PENDING")
case QiboJobStatus.RUNNING:
logger.info("Job RUNNING")
case QiboJobStatus.POSTPROCESSING:
logger.info("Job POSTPROCESSING")
case QiboJobStatus.SUCCESS:
logger.info("Job COMPLETED")
case QiboJobStatus.ERROR:
logger.info("Job COMPLETED")

if verbose and job_status == QiboJobStatus.QUEUEING:
logger.info("Job QUEUING")
if verbose and job_status == QiboJobStatus.PENDING:
logger.info("Job PENDING")
if verbose and job_status == QiboJobStatus.RUNNING:
logger.info("Job RUNNING")
if verbose and job_status == QiboJobStatus.POSTPROCESSING:
logger.info("Job POSTPROCESSING")
if job_status in [QiboJobStatus.SUCCESS, QiboJobStatus.ERROR]:
if verbose:
logger.info("Job COMPLETED")
return response, job_status
time.sleep(seconds_between_checks)

0 comments on commit c9672a6

Please sign in to comment.