Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Make queue position refresh optional #387

Merged
merged 3 commits into from
Oct 11, 2019

Conversation

jyu00
Copy link
Collaborator

@jyu00 jyu00 commented Oct 10, 2019

Summary

Introduce a new refresh parameter in job.queue_position() and query the API only if refresh=True.

Details and comments

#329 updated job.queue_position() to query the latest queue position every time it's called (by calling job.status()), with the intent to provide the caller the latest position. This change, however, severs the ties between job status and queue position. For example, job_monitor in qiskit-terra has:

if status.name == 'QUEUED':
    msg += ' (%s)' % job.queue_position()

but the job status may no longer be QUEUED when queue_position() is called, and queue_position() would return None.

To keep backward compatibility for users who rely on status and queue_position being in sync, this PR refreshes queue position only if refresh=True.

@diego-plan9 diego-plan9 merged commit c0ba349 into Qiskit:master Oct 11, 2019
lgarc15 pushed a commit to lgarc15/qiskit-ibmq-provider that referenced this pull request Oct 11, 2019
* make position refresh optional

* update changelog
lgarc15 pushed a commit to lgarc15/qiskit-ibmq-provider that referenced this pull request Oct 11, 2019
* make position refresh optional

* update changelog
lgarc15 pushed a commit to lgarc15/qiskit-ibmq-provider that referenced this pull request Oct 11, 2019
* make position refresh optional

* update changelog
@jyu00 jyu00 deleted the queue_pos_refresh branch October 18, 2019 19:15
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants