Closed
Description
- Laravel Version: 5.4.10
- PHP Version: 7.1.0
Description:
When trying to pass a delayed job to queue when the client is set as phpredis
, exception Symfony\Component\Debug\Exception\FatalThrowableError
is thrown:
Type error: Argument 2 passed to Illuminate\Redis\Connections\PhpRedisConnection::zadd() must be of the type array, integer given,
This is because PhpRedisConnection
accepts array as second parameter:
/**
* Add one or more members to a sorted set or update its score if it already exists.
*
* @param string $key
* @param array $membersAndScoresDictionary
* @return int
*/
public function zadd($key, array $membersAndScoresDictionary)
{
$arguments = [];
foreach ($membersAndScoresDictionary as $member => $score) {
$arguments[] = $score;
$arguments[] = $member;
}
return $this->command('zadd', ...$arguments);
}
But integer (timestamp) is passed in RedisQueue
:
$this->getConnection()->zadd(
$this->getQueue($queue).':delayed', $this->availableAt($delay), $payload
);
Steps To Reproduce:
- Set your
client
indatabase.php
config file asphpredis
- try to add job as delayed:
$job = new ExampleJob($data);
$this->dispatch($job->onQueue('medium')->delay(15 * 60));
Metadata
Metadata
Assignees
Labels
No labels