laravel-s: Using persistent connection for Predis leads to the conflict of database selection

  1. Tell us your software version How to know it?

    # PHP
    php -v
    # Swoole
    php --ri swoole
    # Laravel
    grep 'laravel/framework' composer.json
    # Lumen
    grep 'laravel/lumen-framework' composer.json
    
    Software Version
    PHP 7.3.8
    Swoole 4.3.5
    Laravel/Lumen 5.8.30
  2. Detail description about this issue(error/log)

    redis缓存设置持久化连接后,更新缓存统计数据,数据无变化,去掉持久化连接选项后,恢复正常

  3. Give us a reproducible code block and steps

    \Cache::store('redis')->increment('statics');//假如值为100,更新数据后无变化
    

去除cache中的持久化连接,缓存数据更新成功 QQ20190806-181524@2x

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 27 (9 by maintainers)

Most upvoted comments

@Rivsen 的确,在开启持久连接的情况下,使用predis会是同一个连接,db会冲突,而phpredis则表现正常。 @ashuiccc 可将Redis client切换为phpredis,参考此文档@Rivsen 感谢支持。