@@ -322,6 +322,7 @@ def request(
322322 path : str ,
323323 * ,
324324 use_cache : bool = False ,
325+ reset_cache : bool = False ,
325326 use_api_key : bool = False ,
326327 ** request_kwargs : Any ,
327328 ) -> Response :
@@ -345,7 +346,7 @@ def request(
345346 timeout = request_kwargs .pop ("timeout" , self .timeout )
346347 files = request_kwargs .pop ("files" , None )
347348
348- if use_cache and self .cache is not None :
349+ if use_cache and not reset_cache and self .cache is not None :
349350 cache_key = self .cache .get_key (url , params )
350351 try :
351352 return self .cache .load (cache_key )
@@ -379,6 +380,7 @@ def request(
379380 assert response is not None
380381
381382 if use_cache and self .cache is not None :
383+ cache_key = self .cache .get_key (url , params )
382384 self .cache .save (cache_key , response )
383385
384386 return response
@@ -388,13 +390,15 @@ def get(
388390 path : str ,
389391 * ,
390392 use_cache : bool = False ,
393+ reset_cache : bool = False ,
391394 use_api_key : bool = False ,
392395 ** request_kwargs : Any ,
393396 ) -> Response :
394397 return self .request (
395398 method = "GET" ,
396399 path = path ,
397400 use_cache = use_cache ,
401+ reset_cache = reset_cache ,
398402 use_api_key = use_api_key ,
399403 ** request_kwargs ,
400404 )
0 commit comments