laravel-s: Using persistent connection for Predis leads to the conflict of database selection
-
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.jsonSoftware Version PHP 7.3.8Swoole 4.3.5Laravel/Lumen 5.8.30 -
Detail description about this issue(error/log)
redis缓存设置持久化连接后,更新缓存统计数据,数据无变化,去掉持久化连接选项后,恢复正常 -
Give us a
reproduciblecode block andsteps\Cache::store('redis')->increment('statics');//假如值为100,更新数据后无变化
去除cache中的持久化连接,缓存数据更新成功

About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (9 by maintainers)
@Rivsen 的确,在开启持久连接的情况下,使用predis会是同一个连接,
db会冲突,而phpredis则表现正常。 @ashuiccc 可将Redis client切换为phpredis,参考此文档。 @Rivsen 感谢支持。