Skip to content

Commit 23affe0

Browse files
committed
adjsut for new cache work
1 parent 9cb1b84 commit 23affe0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

astroquery/mast/discovery_portal.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
from astropy.table import Table, vstack, MaskedColumn
2020

21-
from ..query import BaseQuery
21+
from astroquery import conf as asq_conf
22+
from ..query import BaseQuery, QueryWithLogin, AstroQuery, to_cache
2223
from ..utils import async_to_sync
2324
from ..utils.class_or_instance import class_or_instance
2425
from ..exceptions import InputWarning, NoResultsWarning, RemoteServiceError
@@ -216,11 +217,12 @@ def _request_w_cache(self, method, url, data=None, headers=None, retrieve_all=Tr
216217
# Note: the method only exposes 4 parameters of the underlying _request() function
217218
# to play nice with existing mocks
218219
# Caching: follow BaseQuery._request()'s pattern, which uses an AstroQuery object
220+
219221
if not cache:
220222
response = self._request(method, url, data=data, headers=headers, retrieve_all=retrieve_all)
221223
else:
222224
cacher = self._get_cacher(method, url, data, headers, retrieve_all)
223-
response = cacher.from_cache(self.cache_location)
225+
response = cacher.from_cache(self.cache_location, asq_conf.cache_timeout)
224226
if not response:
225227
response = self._request(method, url, data=data, headers=headers, retrieve_all=retrieve_all)
226228
to_cache(response, cacher.request_file(self.cache_location))

0 commit comments

Comments
 (0)