Skip to content

Commit f7638d4

Browse files
committed
always upload local files
1 parent e906fb5 commit f7638d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/backend/prepdocslib/blobmanager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ async def upload_blob(self, file: File) -> str:
424424
await container_client.create_container()
425425

426426
# Re-open and upload the original file
427-
if file.url is None:
427+
# URL may be a path to a local file or already set to a blob URL
428+
if file.url is None or os.path.exists(file.url):
428429
with open(file.content.name, "rb") as reopened_file:
429430
blob_name = self.blob_name_from_file_name(file.content.name)
430431
logger.info("Uploading blob for document '%s'", blob_name)

0 commit comments

Comments
 (0)