Skip to content

Commit

Permalink
Merge pull request #25 from NaturalHistoryMuseum/dev
Browse files Browse the repository at this point in the history
v0.12.1
  • Loading branch information
jrdh authored May 16, 2022
2 parents ffcb50c + a4392e5 commit bbd1205
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions iiif/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def pct(self) -> str:
:return: the percentage the cache is in use as a formatted string
"""
return f'{(self.total_size / self.max_size):.2f}%'
return f'{((self.total_size / self.max_size) * 100):.2f}%'

def _clean_up(self, path: Path):
"""
Expand Down Expand Up @@ -361,7 +361,11 @@ async def use(self, fetchable: Fetchable) -> Path:
elif not path.exists():
async with self._locker.acquire(path, timeout=self.fetch_timeout):
if not path.exists():
await self._fetch(fetchable)
try:
await self._fetch(fetchable)
except Exception:
self.errors += 1
raise
self._sizes[path] = path.stat().st_size
self.total_size += self._sizes[path]

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

setup(
name="iiif-image-server",
version='0.10.0',
version='0.12.1',
author='Natural History Museum',
author_email='data@nhm.ac.uk',
description="A media server primarily used by the NHM Data Portal",
Expand Down

0 comments on commit bbd1205

Please sign in to comment.