yiisoft / yiisoft/yii2-queue

Default TTR from config seems not to be apllied

Open
#489 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.1k
Forks
285
Avg merge
5d 3h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at yii\queue\Queue::$ttr and trace how the configured queue component is used when a job is created without an explicit TTR. Reproduce the issue with the shown database queue configuration and compare the effective value with the job-specific path; done when the configured 600-second default is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.