mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 00:11:53 +00:00
return false if json_encode()
failed.
This commit is contained in:
parent
df69e8980c
commit
9c20e44483
@ -101,8 +101,12 @@ class Resque
|
|||||||
*/
|
*/
|
||||||
public static function push($queue, $item)
|
public static function push($queue, $item)
|
||||||
{
|
{
|
||||||
|
$encodedItem = json_encode($item);
|
||||||
|
if ($encodedItem === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
self::redis()->sadd('queues', $queue);
|
self::redis()->sadd('queues', $queue);
|
||||||
$length = self::redis()->rpush('queue:' . $queue, json_encode($item));
|
$length = self::redis()->rpush('queue:' . $queue, $encodedItem);
|
||||||
if ($length < 1) {
|
if ($length < 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user