hyperf-redis-lock
hyperf-redis-lock copied to clipboard
a distributed-redis-lock implementation for hyperf2.*
Fatal error: Trait "Hyperf\Utils\InteractsWithTime" not found in /opt/www/vendor/lysice/hyperf-redis-lock/src/Lock.php on line 8
增加了读锁与写锁
fix:修复hyperf3.1报错问题
大佬什么时候可以适配一下 hyperf 3.1呀
获取锁和给锁加过期时间应该要是原子操作,要在acquire方法里这样用 `$lock = $this->redis->set('my_lock', 1, ['nx' => true, 'ex' => $this->ttl])` 另外需要考虑锁重入、锁续命
master分支的acquire方法是有问题的,setnx失败就不设置过期时间了,v2分支的可以用