Closed yundou147 closed 2 years ago
已实际测试,已导致我程序每次启动都要卡很久
我现在解决方法是: if (lockResult.Unlock()) { RedisHelper.Del("CSRedisClientLock:init_db_lock"); }
Unlock 会删掉 CSRedisClientLock:init_db_lock 的,你看看是不是自己程序重新加了锁。
Unlock 会删掉 CSRedisClientLock:init_db_lock 的,你看看是不是自己程序重新加了锁。
我看了key key没有删除掉 但是这个key的value 是空的
你单独写一个 console app 测试,看会不会删
var lockResult = RedisHelper.Lock("init_db_lock", 3) ockResult.Unlock();
观察redis数据发现 没有删除对应的key (看源码内部是:CSRedisClientLock:init_db_lock)
导致结果:再次获取锁的时候要等待上次锁超时的后才能获取