-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Closed
Description
- Laravel Version: 5.4
- PHP Version: 7.1.2
- Database Driver & Version: Mysql 5.7.17
- Dev Environment: Homestead
Description:
I've been trying to do some video uploads to s3 via a job, but for an unknown reason, it just gets killed each time i run php artisan queue:work, but the odd thing is that I used the same job to upload a file image instead of a video and for an unknow reasons, it works, it fails only when I try to upload a video.
Here's the job in question:
<?php
namespace App\Jobs;
use File;
use App\Models\Video;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Storage;
class UploadVideo implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $filename;
/**
* Create a new job instance.
*
* @param $filename
* @internal param Video $video
*/
public function __construct($filename)
{
$this->filename = $filename;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$file = storage_path() . '/uploads/' . $this->filename;
if (Storage::disk('s3telestream')->put($this->filename, fopen($file, 'r+'))) {
File::delete($file);
}
}
}
Metadata
Metadata
Assignees
Labels
No labels