Skip to content

Commit

Permalink
fix: fixed bug in file accessibility check
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik committed Jul 22, 2024
1 parent 03ab345 commit b8ef9b9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions aidial_adapter_dial/utils/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ async def is_accessible(
) -> bool:
try:
await self._get_metadata(url, session)
log.debug(f"file is accessible: url={url!r}")
return True
except AccessDeniedError:
log.debug(f"file isn't accessible: url={url!r}")
return False
finally:
log.debug(f"file is accessible: url={url!r}")
return True

def to_metadata_url(self, url: str) -> str:
"""
Expand All @@ -87,9 +86,7 @@ def to_metadata_url(self, url: str) -> str:
return urljoin(metadata_url, url, allow_fragments=True)

async def _get_metadata(
self,
url: str,
session: aiohttp.ClientSession,
self, url: str, session: aiohttp.ClientSession
) -> dict:
metadata_url = self.to_metadata_url(url)

Expand Down

0 comments on commit b8ef9b9

Please sign in to comment.