robbiepaul / cloudconvert-laravel

A Laravel wrapper for the CloudConvert API
177 stars 34 forks source link

CloudConvert is returning from S3 before upload is even complete. #62

Open YCMitch opened 5 years ago

YCMitch commented 5 years ago

Or perhaps I'm expecting the conversion to be synchronous, and it's not?

I've got the below code, which successfully converts a file and uploads it to S3. However, $thumbUrl is returning a URL before the upload is complete, meaning my returned image thumbnail 404s.

Is this intended behaviour? If so, is there a way to have it run synchronously? This whole process is already on a queue, so it's probably excessive to queue from within a queue...

$cloudConvertInstance->file($cloudConvertInstance->S3($folder.$fileName))
    ->withOptions([
        'quality' => 80,
        'resize' => '400x400',
    ])->to($cloudConvertInstance->S3($folder.$tempName));

$thumbUrl = Storage::disk('s3')->url($folder.$tempName);