Skip to content

Commit

Permalink
Fixes upload fails for non-existent partner video upload to S3 (#2849)
Browse files Browse the repository at this point in the history
Previously, the S3 upload flow attempted to upload a partner video regardless
of its existence, resulting in an error when the video was missing. This error
prevented the job responsible for uploading the original variant to S3 from
completing successfully.

This commit adds a check to ensure the partner video exists before attempting
to upload, resolving the issue and allowing the job to complete as expected.
  • Loading branch information
kiancross authored Dec 27, 2024
1 parent 8cc5f42 commit 148ec74
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Jobs/UploadSizeVariantToS3Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ private function handleVideoPartner(): void

$photo = Photo::query()->where('id', '=', $this->variant->photo_id)->first();

if ($photo->live_photo_short_path === null) {
return;
}

Storage::disk(StorageDiskType::S3->value)->writeStream(
$photo->live_photo_short_path,
Storage::disk(StorageDiskType::LOCAL->value)->readStream($photo->live_photo_short_path)
Expand Down

0 comments on commit 148ec74

Please sign in to comment.