Answer the question
In order to leave comments, you need to log in
What is the problem of downloading a file in a queue?
Good afternoon. I came across a problem with the inability to upload a file to the server in the queue. I use yiisoft/yii2-queue with redis driver.
$this->video = hash('MD5', $this->video_file->baseName . floor($this->task_id / 1000)) . '.' . $this->video_file->extension;
$filepath = $this->getRelativeVideoPath() . $this->video;
Yii::$app->queue->push(new TaskVideoJob([
'file' => $this->video_file,
'path' => $filepath,
]));
class TaskVideoJob extends BaseObject implements JobInterface
{
public $file;
public $path;
public function execute($queue)
{
$this->file->saveAs($this->path);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question