Skip to content

Commit d35b0b5

Browse files
committed
adjsut for new cache work
1 parent 441c246 commit d35b0b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

astroquery/mast/discovery_portal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from astropy.table import Table, vstack, MaskedColumn
2020
from astropy.utils import deprecated
2121

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

0 commit comments

Comments
 (0)