Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion qiskit_experiments/database_service/db_experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,16 +781,20 @@ def cancel_jobs(self) -> None:
except Exception as err: # pylint: disable=broad-except
LOG.info("Unable to cancel job %s: %s", job.job_id(), err)

def block_for_results(self, timeout: Optional[float] = None) -> None:
def block_for_results(self, timeout: Optional[float] = None) -> "DbExperimentDataV1":
"""Block until all pending jobs and their post processing finish.

Args:
timeout: Timeout waiting for results.

Returns:
The experiment data with finished jobs and post-processing.
"""
for job, fut in self._job_futures.copy():
LOG.info("Waiting for job %s and its post processing to finish.", job.job_id())
with contextlib.suppress(Exception):
fut.result(timeout)
return self

def status(self) -> str:
"""Return the data processing status.
Expand Down