Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default TTR from config seems not to be apllied #489

Open
gb5256 opened this issue Jun 27, 2023 · 4 comments
Open

Default TTR from config seems not to be apllied #489

gb5256 opened this issue Jun 27, 2023 · 4 comments

Comments

@gb5256
Copy link

gb5256 commented Jun 27, 2023

What steps will reproduce the problem?

I am using this config:

'components' => [
   ...
    'queue' => [
        'class' => '\yii\queue\db\Queue::class', 
        'as log' => \yii\queue\LogBehavior::class,
        'db' => 'db', 
        'tableName' => '{{%queue}}', 
        'channel' => 'default',
        'mutex' => \yii\mutex\MysqlMutex::class,
        'ttr' => 600,
    ],

What's expected?

I expect that if I create a job without mentioning a specific ttr in the job, that it then takes the default value.

What do you get instead?

It always uses 300 s (as it is defined inside yii\queue\Queue : public $ttr = 300;

Additional info

Q A
Yii version 2.0.48.1
PHP version 8.0
Operating system Ubuntu 18.04 LTS
@s1lver
Copy link
Member

s1lver commented Jun 28, 2023

What version of yii2-queue are you using?

@gb5256
Copy link
Author

gb5256 commented Jun 29, 2023

@s1lver : I am using yii-queue version 2.3.5

@ghost
Copy link

ghost commented Aug 9, 2023

@gb5256 can you share the code you use to push job to redis queue?
redis driver will load ttr from job by default

@yuuues
Copy link

yuuues commented Oct 10, 2023

Hi!!

As a workaround, we've found that when calling to the queue and making a push

Yii::$app->yourqueue->push(new YourWorker([]));

You can call ttr function to edit manually the TTR applied. So your call would be like

Yii::$app->yourqueue->ttr($yourTtrInSeconds)->push(new YourWorker([]));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants