Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hermit/shards/shard_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _ensure_shards(self, shards_expected: bool = True) -> None:
# If for some reason the persistence layer failed to create the
# the shards file, we assume that we just need to initialize
# it as an empty bson object.
if not os.path.exists(self.config.shards_file):
if not os.path.exists(self.config.shards_file) or os.stat(self.config.shards_file).st_size == 0:
with open(self.config.shards_file, 'wb') as f:
f.write(bson.dumps({}))

Expand Down