Skip to content

Commit

Permalink
No need for try
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Sep 20, 2024
1 parent df41d9a commit 8073a5f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions chia/data_layer/data_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,18 +638,15 @@ async def fetch_and_validate(self, store_id: bytes32) -> None:
)
# Had trouble with this generation, so generate full file for the generation we currently have
if not os.path.exists(filename_full_tree):
try:
with open(filename_full_tree, "wb") as writer:
await self.data_store.write_tree_to_file(
root=root,
node_hash=root.node_hash,
store_id=store_id,
deltas_only=False,
writer=writer,
)
self.log.info(f"Successfully written full tree filename {filename_full_tree}.")
except FileNotFoundError:
pass # ignore any problems with writing the file
with open(filename_full_tree, "wb") as writer:
await self.data_store.write_tree_to_file(
root=root,
node_hash=root.node_hash,
store_id=store_id,
deltas_only=False,
writer=writer,
)
self.log.info(f"Successfully written full tree filename {filename_full_tree}.")

async def get_downloader(self, store_id: bytes32, url: str) -> Optional[PluginRemote]:
request_json = {"store_id": store_id.hex(), "url": url}
Expand Down

0 comments on commit 8073a5f

Please sign in to comment.