Changeset View
Changeset View
Standalone View
Standalone View
swh/fuse/fuse.py
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | async def get_history(self, swhid: SWHID) -> List[SWHID]: | ||||
# most recent artifacts from the archive. Computing the full history | # most recent artifacts from the archive. Computing the full history | ||||
# from the Web API is too computationally intensive so simply return | # from the Web API is too computationally intensive so simply return | ||||
# an empty list. | # an empty list. | ||||
return [] | return [] | ||||
async def get_visits(self, url_encoded: str) -> List[Dict[str, Any]]: | async def get_visits(self, url_encoded: str) -> List[Dict[str, Any]]: | ||||
""" Retrieve origin visits given an encoded-URL using Software Heritage API """ | """ Retrieve origin visits given an encoded-URL using Software Heritage API """ | ||||
cache = await self.cache.metadata.get_visits(url_encoded) | cache = await self.cache.metadata.get_visits(url_encoded, check_timestamp=True) | ||||
if cache: | if cache: | ||||
self.logger.debug( | self.logger.debug( | ||||
"Found %d visits for origin '%s' in cache", len(cache), url_encoded, | "Found %d visits for origin '%s' in cache", len(cache), url_encoded, | ||||
) | ) | ||||
return cache | return cache | ||||
try: | try: | ||||
self.logger.debug( | self.logger.debug( | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |