Skip to content

Commit

Permalink
Fixed create_clone bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Jan 30, 2024
1 parent 020b7d6 commit 4200bb4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions librarian_background/create_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def core(self, session: Session):
# Now we can clone the file to the clone_to store.
try:
staging_name, staged_path = store_to.store_manager.stage(
file_size=instance.file.size, file_name=instance.file.name
file_size=instance.file.size,
file_name=Path(instance.file.name).name,
)
except ValueError:
# TODO: In the future where we have multiple potential clone stores for SneakerNet we should
Expand Down Expand Up @@ -212,8 +213,12 @@ def core(self, session: Session):

continue

resolved_store_path = store_to.store_manager.store(
Path(instance.file.name)
)

store_to.store_manager.commit(
staging_path=staged_path, store_path=Path(instance.file.name)
staging_path=staged_path, store_path=resolved_store_path
)
except FileExistsError:
log_to_database(
Expand Down

0 comments on commit 4200bb4

Please sign in to comment.