Skip to content

Commit

Permalink
Merge pull request #440 from jwfraustro/wait-rapid-polling-fix
Browse files Browse the repository at this point in the history
Fix rapid polling cause by unsupported WAIT parameter.
  • Loading branch information
tomdonaldson authored May 10, 2023
2 parents 4c16d3a + ee63345 commit b5f5b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

- Deprecating ``ivoid2service`` because it is ill-defined. [#439]

- Fix poor polling behavior when running an async query against a
TAP v1.1 service with unsupported WAIT parameter. [#440]


1.4.1 (2023-03-07)
==================
Expand Down
8 changes: 3 additions & 5 deletions pyvo/dal/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from functools import partial
from datetime import datetime
from time import sleep
from packaging.version import Version

import requests
from urllib.parse import urlparse, urljoin
Expand Down Expand Up @@ -922,10 +921,9 @@ def wait(self, phases=None, timeout=600.):
if cur_phase in phases:
break

# fallback for uws 1.0
if Version(self._job.version) < Version("1.1"):
sleep(interval)
interval = min(120, interval * increment)
# fallback for uws 1.0 or unsupported WAIT parameter
sleep(interval)
interval = min(120, interval * increment)

return self

Expand Down

0 comments on commit b5f5b37

Please sign in to comment.