Skip to content

Commit

Permalink
getting default timeout value directly from conf
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymedina committed May 5, 2023
1 parent e0377e5 commit 9c6ff8b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions astroquery/mast/cutouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from astropy.table import Table
from astropy.io import fits

from . import conf
from .. import log
from ..exceptions import InputWarning, LargeQueryWarning, NoResultsWarning, InvalidQueryError

Expand Down Expand Up @@ -150,11 +151,6 @@ def __init__(self):
}
self._service_api_connection.set_service_params(services, "tesscut")

def _get_default_timeout(self):
""" Gets the default request timeout limit. """

return self._service_api_connection.TIMEOUT

def get_sectors(self, *, coordinates=None, radius=0*u.deg, product='SPOC', objectname=None,
moving_target=False, mt_type=None):

Expand Down Expand Up @@ -344,7 +340,7 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, product='SP

# Modify TIMEOUT attribute if necessary (usually this is modified for large requests)
if timeout:
default_timeout = self._get_default_timeout()
default_timeout = conf.timeout
self._service_api_connection.TIMEOUT = timeout
log.info(f"Request timeout upper limit is being changed to {self._service_api_connection.TIMEOUT}"
" seconds.")
Expand Down Expand Up @@ -488,7 +484,7 @@ def get_cutouts(self, *, coordinates=None, size=5, product='SPOC', sector=None,

# Modify TIMEOUT attribute if necessary (usually this is modified for large requests)
if timeout:
default_timeout = self._get_default_timeout()
default_timeout = conf.timeout
self._service_api_connection.TIMEOUT = timeout
log.info(f"Request timeout upper limit is being changed to {self._service_api_connection.TIMEOUT}"
" seconds.")
Expand Down

0 comments on commit 9c6ff8b

Please sign in to comment.