[docs]asyncdefstore(self,key:str,response:Response,request:Request,metadata:Metadata|None=None,)->None:# XXX this looks like the wrong place to do it, but hishel depends on this behaviour. Let's mimic the other# storages, for now.metadata=metadataorMetadata(cache_key=key,created_at=datetime.now(timezone.utc),number_of_uses=0)awaitself._impl.store(key,request=request,response=response,metadata=metadata,)
[docs]asyncdefretrieve(self,key:str)->tp.Optional[StoredResponse]:try:returnawaitself._impl.retrieve(key)exceptException:logger.exception("Failed to retrieve cache")