cheprasov / php-redis-client

RedisClient is a fast, fully-functional and user-friendly client for Redis, optimized for performance. RedisClient supports the latest versions of Redis starting from 2.6 to 6.0
MIT License
127 stars 41 forks source link

Calling time() from pipeline or multi results in an error #72

Closed RichardLowe closed 4 years ago

RichardLowe commented 5 years ago

Hello! Thanks for this client, works great.

One thing, it seems because there's a $parserId set when the ->time() command is called in multi cases (not sure about pipeline too maybe?), that the client tries to parse the QUEUED string result right away resulting in errors like this:

FRAME    3. RedisClient\\Client\\AbstractRedisClient->executePipeline(RedisClient\\Pipeline\\Version\\Pipeline5x0 object) /home/vagrant/ttus/debesys/risk/vendor/cheprasov/php-redis-client/src/RedisClient/Client/AbstractRedisClient.php:281
FRAME    4. RedisClient\\Pipeline\\AbstractPipeline->parseResponse(Array) /home/vagrant/ttus/debesys/risk/vendor/cheprasov/php-redis-client/src/RedisClient/Client/AbstractRedisClient.php:235
FRAME    5. RedisClient\\Command\\Response\\ResponseParser::parse(3, "QUEUED") /home/vagrant/ttus/debesys/risk/vendor/cheprasov/php-redis-client/src/RedisClient/Pipeline/AbstractPipeline.php:110
 FRAME    6. RedisClient\\Command\\Response\\ResponseParser::parseTime("QUEUED") /home/vagrant/ttus/debesys/risk/vendor/cheprasov/php-redis-client/src/RedisClient/Command/Response/ResponseParser.php:34
FRAME    7. myErrorHandler(4096, "Argument 1 passed to RedisClient\\Command\\Response\\ResponseParser::parseTime() must be of the type array, string given, called in....

Thanks again for the great client!

RichardLowe commented 5 years ago

Sorry, in the subject I said pipeline - again not sure maybe just a multi pipeline not pipeline alone - not sure.

cheprasov commented 5 years ago

Hi @RichardLowe Thanks a lot for the issue, I will fix it soon :)

cheprasov commented 5 years ago

Hi @RichardLowe I created branch v191 https://github.com/cheprasov/php-redis-client/tree/v191 Now, the bug should be fixed. Could you please check your code with the branch if it is possible? I am going to realise a new version soon. Thanks.