Skip to content

Commit

Permalink
fix bug in backend.jobs
Browse files Browse the repository at this point in the history
This bug would cause the method to miss first "limit" number of jobs.
  • Loading branch information
ewinston committed Jun 13, 2018
1 parent 7ce53ea commit f98e4ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qiskit/backends/ibmq/ibmqbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def jobs(self, limit=50, skip=0, status=None):
status = JobStatus[status]
while len(job_list) < limit or len(job_info_list) < limit:
base_index += limit
job_info_list = self._api.get_jobs(limit=limit, skip=base_index)
for job_info in job_info_list:
is_device = not bool(self._configuration.get('simulator'))
job = IBMQJob.from_api(job_info, self._api, is_device)
Expand All @@ -171,6 +170,8 @@ def jobs(self, limit=50, skip=0, status=None):
job_list.append(job)
elif job.status.get('status') == status:
job_list.append(job)
job_info_list = self._api.get_jobs(limit=limit, skip=base_index,
backend=backend_name)
return job_list

def retrieve_job(self, job_id):
Expand Down

0 comments on commit f98e4ab

Please sign in to comment.