Skip to content

Commit

Permalink
fixed a bit of cache crashing if file gets deleted during generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Barakudum committed Feb 4, 2024
1 parent 1e3e891 commit dab9a46
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/jarklin/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,17 @@ def generate_info_file():
logging.error(f"Cache: generation failed ({generator})", exc_info=error)
continue
generate_info_file()
info.append(InfoEntry(
path=str(source.relative_to(self.root)),
name=source.stem,
ext=source.suffix,
ctime=get_ctime(source),
mtime=get_mtime(source),
meta=json.loads(dest.joinpath("meta.json").read_bytes()),
))
try:
info.append(InfoEntry(
path=str(source.relative_to(self.root)),
name=source.stem,
ext=source.suffix,
ctime=get_ctime(source),
mtime=get_mtime(source),
meta=json.loads(dest.joinpath("meta.json").read_bytes()),
))
except FileNotFoundError:
continue

generate_info_file()

Expand Down

0 comments on commit dab9a46

Please sign in to comment.