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

resolve issue in db driver to set delay job #208

Closed
wants to merge 1 commit into from
Closed

resolve issue in db driver to set delay job #208

wants to merge 1 commit into from

Conversation

farmani
Copy link
Contributor

@farmani farmani commented Feb 8, 2018

#207

PHP Warning 'yii\base\ErrorException' with message 'sleep() expects parameter 1 to be integer, string given'

#207

PHP Warning 'yii\base\ErrorException' with message 'sleep() expects parameter 1 to be integer, string given'
@@ -74,6 +74,7 @@ public function init()
*/
public function run($repeat, $delay = 0)
{
$delay = intval($delay);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(int) $delay

@samdark samdark added type:bug Bug status:to be verified Needs to be reproduced and validated. and removed status:to be verified Needs to be reproduced and validated. labels Feb 8, 2018
@samdark samdark added this to the 2.0.3 milestone Feb 8, 2018
@samdark
Copy link
Member

samdark commented Feb 8, 2018

Please add a line to changelog.

@samdark samdark requested a review from zhuravljov February 8, 2018 10:24
@@ -74,6 +74,7 @@ public function init()
*/
public function run($repeat, $delay = 0)
{
$delay = intval($delay);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it is wrong way. $delay param comes from console command as timeout option:

public function actionListen($timeout = 3)
{
return $this->queue->run(true, $timeout);
}

I think, it should be made as timeout param validation:

    public function actionListen($timeout = 3)
    {
        if (!is_numeric($timeout)) {
            throw new \yii\console\Exception('Timeout must be numeric.');
        }
        if ($timeout < 1) {
            throw new \yii\console\Exception('Timeout must be greater that zero.');
        }

        return $this->queue->run(true, $timeout);
    }

@samdark
Copy link
Member

samdark commented Feb 22, 2018

Closing then, won't be merged.

@samdark samdark closed this Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants