Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astrometry.net: reduce number of calls when polling for job status #3079

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions astroquery/astrometry_net/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ def monitor_submission(self, submission_id, *,
status = ''
while not has_completed:
time.sleep(1)
sub_stat_url = url_helpers.join(self.API_URL, 'submissions', str(submission_id))
sub_stat = self._request('GET', sub_stat_url, cache=False)
jobs = sub_stat.json()['jobs']
if jobs:
job_id = jobs[0]
if job_id is None:
sub_stat_url = url_helpers.join(self.API_URL, 'submissions', str(submission_id))
sub_stat = self._request('GET', sub_stat_url, cache=False)
jobs = sub_stat.json()['jobs']
if jobs:
job_id = jobs[0]
if job_id:
job_stat_url = url_helpers.join(self.API_URL, 'jobs',
str(job_id), 'info')
Expand Down
Loading