A
A
Askar Fuzaylov2015-10-09 15:16:08
Yii
Askar Fuzaylov, 2015-10-09 15:16:08

Why is the gearman background task not being added?

Hello.
There are 2 tasks, one of them processes the file and the other deletes it.
The first task works out normally under the pressure of the task. But the second one does not want to be added.
I am using Filsh/yii2-gearman
console.php

...
'gearman' => [
            'class' => 'filsh\yii2\gearman\GearmanComponent',
            'servers' => [
                ['host' => '127.0.0.1', 'port' => 4730],
            ],
            'user' => 'php.lamuz',
            'jobs' => [
                'ffmpeg' => [
                    'class' => 'app\common\jobs\FfmpegHandler',
                    'path' => '...'
                ],
                'delete' => [
                    'class' => 'app\common\jobs\DeleteHandler',
                    'path' => '...'
                ]
            ]
        ],
...

adding a task. For some reason this task is not added. (ffmpeg task works fine)
$handler = \Yii::$app->gearman->getDispatcher()->background('delete', new JobWorkload([
            'params' => [
                'id' => $model->id,
                'filePath' => $this->getPath($model)
            ]
        ]), Dispatcher::NORMAL, mt_rand(1, 9));

If I print $handler I get a string instead of a resource. string(14) "H:vps-28-15:17"
I can't figure out why it's not added.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kiyashko, 2015-10-10
@konst20

From the assumptions:
1) rename the task, I saw such a rake
2) somewhere in the process of adding a task, the process crashes. Otmonitorte
Question: how do you watch the queue?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question