Skip to content

Commit

Permalink
remove if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
DGaffney committed Jan 3, 2024
1 parent 3373365 commit b00b83a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/model/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def process(self, video: schemas.Message) -> schemas.GenericItem:
)
s3.upload_file_to_s3(self.tmk_bucket(), self.tmk_file_path(video_filename))
finally:
os.remove(self.tmk_file_path(video_filename))
os.remove(temp_file_name)
for file_path in [self.tmk_file_path(video_filename), temp_file_name]:
if os.path.exists(file_path):
os.remove(file_path)
return dict(**video.dict(), **{"folder": self.tmk_bucket(), "filepath": self.tmk_file_path(video_filename), "hash_value": hash_value})

0 comments on commit b00b83a

Please sign in to comment.