Redis-php-resque encountering pitfalls

Source: Internet
Author: User
Resque: enqueue stores data in the redis queue, and the json_decode obtained by the worker is sometimes incomplete (the probability of a high access volume may be higher, not fully verified )! Very depressing. I read a lot of php-ressue code, which is also very clear. I can't see any problems. In php-ressue... Resque: enqueue stores the data in the redis queue, and the worker obtains the json_decode, which is sometimes incomplete (the probability may be higher when the traffic is large, but it is not fully verified )!
Very depressing. I read a lot of php-ressue code, which is also very clear. I can't see any problems. Log in php-ressue as follows (Rescue. php ),

    public static function pop($queue)    {        $item = self::redis()->lpop('queue:' . $queue);        if(!$item) {            return;        }        $result = json_decode($item, true);        if(!is_array($result)) error_log('why not array : ' . $item);        return $result;            }

The php log appears several times in a day. The $ item output is not a valid json

Which of the following has experience? How do I provide suggestions?

Reply content:

Resque: enqueue stores data in the redis queue, and the json_decode obtained by the worker is sometimes incomplete (the probability of a high access volume may be higher, not fully verified )!
Very depressing. I read a lot of php-ressue code, which is also very clear. I can't see any problems. Log in php-ressue as follows (Rescue. php ),

    public static function pop($queue)    {        $item = self::redis()->lpop('queue:' . $queue);        if(!$item) {            return;        }        $result = json_decode($item, true);        if(!is_array($result)) error_log('why not array : ' . $item);        return $result;            }

The php log appears several times in a day. The $ item output is not a valid json

Which of the following has experience? How do I provide suggestions?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.