From c1ca0c32d8c8f48fe63afc2b795e4ae67c38f630 Mon Sep 17 00:00:00 2001 From: Ramin Farmani Date: Thu, 8 Feb 2018 12:34:16 +0330 Subject: [PATCH] resolve issue in db driver to set delay job https://github.com/yiisoft/yii2-queue/issues/207 PHP Warning 'yii\base\ErrorException' with message 'sleep() expects parameter 1 to be integer, string given' --- src/drivers/db/Queue.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/db/Queue.php b/src/drivers/db/Queue.php index b2533bd057..36e88433bd 100644 --- a/src/drivers/db/Queue.php +++ b/src/drivers/db/Queue.php @@ -74,6 +74,7 @@ public function init() */ public function run($repeat, $delay = 0) { + $delay = intval($delay); return $this->runWorker(function (LoopInterface $loop) use ($repeat, $delay) { while ($loop->canContinue()) { if ($payload = $this->reserve()) { @@ -250,4 +251,4 @@ private function moveExpired() } private $reserveTime; -} \ No newline at end of file +}